]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Fix input-src parse in patch_analog.c
authorAdrian Wilkins <adrian.wilkins@nhs.net>
Thu, 19 May 2011 20:52:38 +0000 (21:52 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Jun 2011 01:34:17 +0000 (10:34 +0900)
commit 5a2d227fdc7a02ed1b4cebba391d8fb9ad57caaf upstream.

Compare pin type enum to the pin type and not the array index.
Fixes bug#0005368.

Signed-off-by: Adrian Wilkins <adrian.wilkins@nhs.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/pci/hda/patch_analog.c

index 7aee90044c685ab313346804efe1d08b446afda3..f8363ae869e867a4d4a20d7a98c3176a4f04c31c 100644 (file)
@@ -3167,6 +3167,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec)
 
        for (i = 0; i < cfg->num_inputs; i++) {
                hda_nid_t nid = cfg->inputs[i].pin;
+               int type = cfg->inputs[i].type;
                switch (nid) {
                case 0x15: /* port-C */
                        snd_hda_codec_write(codec, 0x33, 0, AC_VERB_SET_CONNECT_SEL, 0x0);
@@ -3176,7 +3177,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec)
                        break;
                }
                snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
-                                   i == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN);
+                                   type == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN);
                if (nid != AD1988_PIN_CD_NID)
                        snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
                                            AMP_OUT_MUTE);