Commit ad87c64f authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Don't check invalid HP pin

alc_automute_pin() might be called even if any HP pin is defined, and
it will result in verbs with NID=0.

This patch adds a check for the validity of HP widget before issuing
any verbs.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a1bf8088
...@@ -965,6 +965,8 @@ static void alc_automute_pin(struct hda_codec *codec) ...@@ -965,6 +965,8 @@ static void alc_automute_pin(struct hda_codec *codec)
unsigned int nid = spec->autocfg.hp_pins[0]; unsigned int nid = spec->autocfg.hp_pins[0];
int i; int i;
if (!nid)
return;
pincap = snd_hda_query_pin_caps(codec, nid); pincap = snd_hda_query_pin_caps(codec, nid);
if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
......
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