diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-04-20 07:08:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-04-20 07:08:40 -0400 |
commit | 6942c103fb4b0ce91be910a716044ac181a9c2dd (patch) | |
tree | 5b8314d357777293411e3ff9d863f4b6e52947b6 /sound/pci/hda | |
parent | 4740860b534e86d7db3b26cbd980bec8e4c807e8 (diff) |
ALSA: hda - Skip pin capability sanity check for bogus values
Some old codecs like ALC880 seem to give a bogus pin capability value 0
occasionally. This breaks the new sanity check in snd_hda_set_pin_ctl().
Skip the sanity checks in such a case.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 8b8b74a1284c..408613c13f43 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -4827,14 +4827,14 @@ int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin, | |||
4827 | { | 4827 | { |
4828 | if (val) { | 4828 | if (val) { |
4829 | unsigned int cap = snd_hda_query_pin_caps(codec, pin); | 4829 | unsigned int cap = snd_hda_query_pin_caps(codec, pin); |
4830 | if (val & AC_PINCTL_OUT_EN) { | 4830 | if (cap && (val & AC_PINCTL_OUT_EN)) { |
4831 | if (!(cap & AC_PINCAP_OUT)) | 4831 | if (!(cap & AC_PINCAP_OUT)) |
4832 | val &= ~(AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); | 4832 | val &= ~(AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); |
4833 | else if ((val & AC_PINCTL_HP_EN) && | 4833 | else if ((val & AC_PINCTL_HP_EN) && |
4834 | !(cap & AC_PINCAP_HP_DRV)) | 4834 | !(cap & AC_PINCAP_HP_DRV)) |
4835 | val &= ~AC_PINCTL_HP_EN; | 4835 | val &= ~AC_PINCTL_HP_EN; |
4836 | } | 4836 | } |
4837 | if (val & AC_PINCTL_IN_EN) { | 4837 | if (cap && (val & AC_PINCTL_IN_EN)) { |
4838 | if (!(cap & AC_PINCAP_IN)) | 4838 | if (!(cap & AC_PINCAP_IN)) |
4839 | val &= ~(AC_PINCTL_IN_EN | AC_PINCTL_VREFEN); | 4839 | val &= ~(AC_PINCTL_IN_EN | AC_PINCTL_VREFEN); |
4840 | } | 4840 | } |