diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-11-27 12:22:44 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-11-27 12:22:44 +0100 |
commit | bfc9902599549736b9c6445e1e2235b8542f64a6 (patch) | |
tree | da39d6398dd09f41d25a02faf48379044854f412 | |
parent | 0b587fc4d35afb1bc0fc3d890084bb14c78372dc (diff) | |
download | linux-bfc9902599549736b9c6445e1e2235b8542f64a6.tar.bz2 |
ALSA: hda - Don't trigger pin-sense for STAC/IDT codecs
STAC/IDT codecs seem to behave weird when SET_PIN_SENSE verb is issued
before reading the jack-detection although the TRIG_REQ pin capability
is given by the hardware.
Since snd_hda_jack_detect() issues the SET_PIN_SENSE verb simply judging
from the pincap, we have to revert the change in the commit
d56757abc11a21996d9839c0d4e3b2c3666cd318
ALSA: hda - Replace the rest of jack-detections with snd_hda_jack_detect()
to plain GET_PIN_SENSE verb without triggering.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 2a45375d79f8..6b0bc040c3b1 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4440,7 +4440,14 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid) { if (!nid) return 0; - return snd_hda_jack_detect(codec, nid); + /* NOTE: we can't use snd_hda_jack_detect() here because STAC/IDT + * codecs behave wrongly when SET_PIN_SENSE is triggered, although + * the pincap gives TRIG_REQ bit. + */ + if (snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0) & + AC_PINSENSE_PRESENCE) + return 1; + return 0; } static void stac92xx_line_out_detect(struct hda_codec *codec, |