]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Fix mute-LED GPIO initialization for IDT codecs
authorTakashi Iwai <tiwai@suse.de>
Tue, 31 Jul 2012 08:40:05 +0000 (10:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2012 15:23:15 +0000 (08:23 -0700)
commit 1f43f6c1bc8d740e75b4177eb29110858bb5fea2 upstream.

The IDT codecs initializes the GPIO setup for mute LEDs via
snd_hda_sync_vmaster_hook().  This works in most cases except for the
very first call, which is called before PCM and control creations.
Thus before Master switch is set manually via alsactl, the mute LED
may show the wrong state, depending on the polarity.

Now it's fixed by calling the LED-status update function manually when
no vmaster is set yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/patch_sigmatel.c

index 558a441c6fe8ad6c73c96885933ae58f9736e3a2..d2f2264fa64d206deed8089cd7f55d080ef6b617 100644 (file)
@@ -4420,7 +4420,12 @@ static int stac92xx_init(struct hda_codec *codec)
        snd_hda_jack_report_sync(codec);
 
        /* sync mute LED */
-       snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
+       if (spec->gpio_led) {
+               if (spec->vmaster_mute.hook)
+                       snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
+               else /* the very first init call doesn't have vmaster yet */
+                       stac92xx_update_led_status(codec, false);
+       }
 
        /* sync the power-map */
        if (spec->num_pwrs)