Commit 50dd9050 authored by Hui Wang's avatar Hui Wang Committed by Takashi Iwai

ALSA: hda - add capture mute led support in led_power_filter

Now the led_power_filter() needs to handle 3 situations:
    - only mute_led_nid is set
    - only cap_mute_led_nid is set
    - both mute_led_ind and cap_mute_led_nid are set

BugLink: https://bugs.launchpad.net/bugs/1329580
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: Kailang Yang <kailang@realtek.com>
Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent fc1fad93
...@@ -3403,7 +3403,8 @@ static unsigned int led_power_filter(struct hda_codec *codec, ...@@ -3403,7 +3403,8 @@ static unsigned int led_power_filter(struct hda_codec *codec,
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
if (power_state != AC_PWRST_D3 || nid != spec->mute_led_nid) if (power_state != AC_PWRST_D3 || nid == 0 ||
(nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
return power_state; return power_state;
/* Set pin ctl again, it might have just been set to 0 */ /* Set pin ctl again, it might have just been set to 0 */
...@@ -3563,6 +3564,7 @@ static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, ...@@ -3563,6 +3564,7 @@ static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
spec->gpio_led = 0; spec->gpio_led = 0;
spec->cap_mute_led_nid = 0x18; spec->cap_mute_led_nid = 0x18;
snd_hda_add_verbs(codec, gpio_init); snd_hda_add_verbs(codec, gpio_init);
codec->power_filter = led_power_filter;
} }
} }
......
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