Commit 9cc159c6 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Add codec->inv_jack_detect flag

Yet another broken hardware workaround: there are hardware indicating
the inverted jack detection bit result.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ecac3ed1
...@@ -867,6 +867,7 @@ struct hda_codec { ...@@ -867,6 +867,7 @@ struct hda_codec {
unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
unsigned int no_jack_detect:1; /* Machine has no jack-detection */ unsigned int no_jack_detect:1; /* Machine has no jack-detection */
unsigned int inv_eapd:1; /* broken h/w: inverted EAPD control */ unsigned int inv_eapd:1; /* broken h/w: inverted EAPD control */
unsigned int inv_jack_detect:1; /* broken h/w: inverted detection bit */
unsigned int pcm_format_first:1; /* PCM format must be set first */ unsigned int pcm_format_first:1; /* PCM format must be set first */
unsigned int epss:1; /* supporting EPSS? */ unsigned int epss:1; /* supporting EPSS? */
unsigned int cached_write:1; /* write only to caches */ unsigned int cached_write:1; /* write only to caches */
......
...@@ -39,6 +39,7 @@ EXPORT_SYMBOL_HDA(is_jack_detectable); ...@@ -39,6 +39,7 @@ EXPORT_SYMBOL_HDA(is_jack_detectable);
static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid) static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid)
{ {
u32 pincap; u32 pincap;
u32 val;
if (!codec->no_trigger_sense) { if (!codec->no_trigger_sense) {
pincap = snd_hda_query_pin_caps(codec, nid); pincap = snd_hda_query_pin_caps(codec, nid);
...@@ -46,8 +47,11 @@ static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid) ...@@ -46,8 +47,11 @@ static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid)
snd_hda_codec_read(codec, nid, 0, snd_hda_codec_read(codec, nid, 0,
AC_VERB_SET_PIN_SENSE, 0); AC_VERB_SET_PIN_SENSE, 0);
} }
return snd_hda_codec_read(codec, nid, 0, val = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_PIN_SENSE, 0); AC_VERB_GET_PIN_SENSE, 0);
if (codec->inv_jack_detect)
val ^= AC_PINSENSE_PRESENCE;
return val;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment