]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ALSA: hda - Unmute mixer dynamically in alc662 auto-parser
authorTakashi Iwai <tiwai@suse.de>
Thu, 7 Apr 2011 10:27:32 +0000 (12:27 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 7 Apr 2011 10:49:05 +0000 (12:49 +0200)
Instead of static init array, better to determine the connection and
the mute status of the pin/mixer/DAC route dynamically.  This fixes the
uninitialized mixer 0x0f on ALC892.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c

index 8406248236fe061d373a7e99d9e52d0ebb07e1d7..e3756a7ebee249a93cf476fed3af6e6aff4424f2 100644 (file)
@@ -19319,14 +19319,21 @@ static void alc662_auto_set_output_and_unmute(struct hda_codec *codec,
        hda_nid_t srcs[HDA_MAX_CONNECTIONS];
 
        alc_set_pin_output(codec, nid, pin_type);
-       /* need the manual connection? */
        num = snd_hda_get_connections(codec, nid, srcs, ARRAY_SIZE(srcs));
-       if (num <= 1)
-               return;
        for (i = 0; i < num; i++) {
                if (alc662_mix_to_dac(codec, srcs[i]) != dac)
                        continue;
-               snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, i);
+               /* need the manual connection? */
+               if (num > 1)
+                       snd_hda_codec_write(codec, nid, 0,
+                                           AC_VERB_SET_CONNECT_SEL, i);
+               /* unmute mixer widget inputs */
+               snd_hda_codec_write(codec, srcs[i], 0,
+                                   AC_VERB_SET_AMP_GAIN_MUTE,
+                                   AMP_IN_UNMUTE(0));
+               snd_hda_codec_write(codec, srcs[i], 0,
+                                   AC_VERB_SET_AMP_GAIN_MUTE,
+                                   AMP_IN_UNMUTE(1));
                return;
        }
 }