summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_jack.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-21 15:31:41 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-12 08:43:21 +0100
commit9cc159c6647f505be1205eb5e3fc3b1f84e1d4fd (patch)
tree15f2d457dffa77132ce1996e90fd1f5306dcf70a /sound/pci/hda/hda_jack.c
parentALSA: hda - Add inv_eapd flag to struct hda_codec (diff)
downloadlinux-9cc159c6647f505be1205eb5e3fc3b1f84e1d4fd.tar.xz
linux-9cc159c6647f505be1205eb5e3fc3b1f84e1d4fd.zip
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_jack.c')
-rw-r--r--sound/pci/hda/hda_jack.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 6e9f57bbe667..6479b6501828 100644
--- a/sound/pci/hda/hda_jack.c
+++ b/sound/pci/hda/hda_jack.c
@@ -39,6 +39,7 @@ EXPORT_SYMBOL_HDA(is_jack_detectable);
static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid)
{
u32 pincap;
+ u32 val;
if (!codec->no_trigger_sense) {
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)
snd_hda_codec_read(codec, nid, 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);
+ if (codec->inv_jack_detect)
+ val ^= AC_PINSENSE_PRESENCE;
+ return val;
}
/**