ALSA: hda - Fix a failure of micmute led when having multi adcs
authorHui Wang <hui.wang@canonical.com>
Tue, 11 Oct 2016 02:48:58 +0000 (10:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 07:01:30 +0000 (03:01 -0400)
commit 4875a5f7218068cdeea5f998330dfa3d118b2fea upstream.

On a Dell laptop, there is no global adcs for all input devices, so
the input devices use the different adc, as a result, dyn_adc_switch
is set to true.

In this situation, it is safe to control the micmute led according to
user's choice of muting/unmuting the current input device, since only
current input device path is active, while other input device paths
are inactive and powered down.

Fixes: 00ef99408b6c ('ALSA: hda - add mic mute led hook for dell machines')
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/dell_wmi_helper.c
sound/pci/hda/thinkpad_helper.c

index 9c22f95838efbd31d23448cc26321918c03bd5e1..19d41da79f93cc95500859c9e1690a2d89935d23 100644 (file)
@@ -49,7 +49,7 @@ static void alc_fixup_dell_wmi(struct hda_codec *codec,
                removefunc = true;
                if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) {
                        dell_led_value = 0;
-                       if (spec->gen.num_adc_nids > 1)
+                       if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch)
                                codec_dbg(codec, "Skipping micmute LED control due to several ADCs");
                        else {
                                dell_old_cap_hook = spec->gen.cap_sync_hook;
index 0a4ad5feb82e7817f7036f86c973d02b1dfecb9b..12826ac0381f03f428a74216d52c1009837b2ae0 100644 (file)
@@ -75,7 +75,7 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
                        removefunc = false;
                }
                if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) {
-                       if (spec->num_adc_nids > 1)
+                       if (spec->num_adc_nids > 1 && !spec->dyn_adc_switch)
                                codec_dbg(codec,
                                          "Skipping micmute LED control due to several ADCs");
                        else {