diff options
author | Takashi Iwai <tiwai@suse.de> | 2020-06-18 13:08:30 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2020-06-18 13:22:27 +0200 |
commit | bf61c42a446f58eb61b7af05e9ff0b79aba348b6 (patch) | |
tree | 47cc23d2b8bebd36a40d624e72b51d10fbd4df14 /sound/pci/hda/hda_generic.c | |
parent | Linux 5.8-rc1 (diff) | |
download | linux-bf61c42a446f58eb61b7af05e9ff0b79aba348b6.tar.xz linux-bf61c42a446f58eb61b7af05e9ff0b79aba348b6.zip |
ALSA: hda: generic: Always call led-trigger for mic mute LED
Instead of adding a special hook to trigger the mic-mute LED device,
call it always from the common callback function. It won't hurt even
if no corresponding led cdev is present.
This is basically a preliminary change for the later patches to
convert the all mic-mute LED handling to LED class cdev.
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200618110842.27238-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index f4e9d9445e18..c95ccffbd0cf 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -3923,6 +3923,10 @@ static void call_micmute_led_update(struct hda_codec *codec) spec->micmute_led.led_value = val; if (spec->micmute_led.update) spec->micmute_led.update(codec); +#if IS_REACHABLE(CONFIG_LEDS_TRIGGER_AUDIO) + ledtrig_audio_set(LED_AUDIO_MICMUTE, + spec->micmute_led.led_value ? LED_ON : LED_OFF); +#endif } static void update_micmute_led(struct hda_codec *codec, @@ -4023,16 +4027,6 @@ int snd_hda_gen_add_micmute_led(struct hda_codec *codec, } EXPORT_SYMBOL_GPL(snd_hda_gen_add_micmute_led); -#if IS_REACHABLE(CONFIG_LEDS_TRIGGER_AUDIO) -static void call_ledtrig_micmute(struct hda_codec *codec) -{ - struct hda_gen_spec *spec = codec->spec; - - ledtrig_audio_set(LED_AUDIO_MICMUTE, - spec->micmute_led.led_value ? LED_ON : LED_OFF); -} -#endif - /** * snd_hda_gen_fixup_micmute_led - A fixup for mic-mute LED trigger * @@ -4051,10 +4045,8 @@ static void call_ledtrig_micmute(struct hda_codec *codec) void snd_hda_gen_fixup_micmute_led(struct hda_codec *codec, const struct hda_fixup *fix, int action) { -#if IS_REACHABLE(CONFIG_LEDS_TRIGGER_AUDIO) if (action == HDA_FIXUP_ACT_PROBE) - snd_hda_gen_add_micmute_led(codec, call_ledtrig_micmute); -#endif + snd_hda_gen_add_micmute_led(codec, NULL); } EXPORT_SYMBOL_GPL(snd_hda_gen_fixup_micmute_led); |