Commit b3f1735b authored by Hui Wang's avatar Hui Wang Committed by Greg Kroah-Hartman

ALSA: hda - Fix a failure of micmute led when having multi adcs

commit 4875a5f7 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: 00ef9940 ('ALSA: hda - add mic mute led hook for dell machines')
Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9058e7d7
...@@ -49,7 +49,7 @@ static void alc_fixup_dell_wmi(struct hda_codec *codec, ...@@ -49,7 +49,7 @@ static void alc_fixup_dell_wmi(struct hda_codec *codec,
removefunc = true; removefunc = true;
if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) {
dell_led_value = 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"); codec_dbg(codec, "Skipping micmute LED control due to several ADCs");
else { else {
dell_old_cap_hook = spec->gen.cap_sync_hook; dell_old_cap_hook = spec->gen.cap_sync_hook;
......
...@@ -75,7 +75,7 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec, ...@@ -75,7 +75,7 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
removefunc = false; removefunc = false;
} }
if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) { 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, codec_dbg(codec,
"Skipping micmute LED control due to several ADCs"); "Skipping micmute LED control due to several ADCs");
else { else {
......
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