From 7cdf8c49b1df0a385db06c4f9a5ba1b16510fdcc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 18 Jun 2020 13:08:31 +0200 Subject: ALSA: hda: generic: Add a helper for mic-mute LED with LED classdev A new helper, snd_hda_gen_add_micmute_led_cdev(), is introduced here for creating a LED classdev and setting up the hook to the capture control for controlling the mic-mute LED to follow the capture switch change. This will replace the existing users of snd_hda_gen_add_micmute_led() in later patches. Also, introduce a new kconfig CONFIG_SND_HDA_GENERIC_LEDS, to indicate the usage of mute / mic-mute LED helpers. It's selected by the codec drivers (Realtek, Conexant and Sigmatel), while it selects the necessary LED class dependencies. Tested-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200618110842.27238-3-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sound/pci/hda/hda_generic.h') diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index fb9f1a90238b..f56bc8da20b2 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -8,6 +8,8 @@ #ifndef __SOUND_HDA_GENERIC_H #define __SOUND_HDA_GENERIC_H +#include + /* table entry for multi-io paths */ struct hda_multi_io { hda_nid_t pin; /* multi-io widget pin NID */ @@ -357,5 +359,8 @@ int snd_hda_gen_add_micmute_led(struct hda_codec *codec, void (*hook)(struct hda_codec *)); void snd_hda_gen_fixup_micmute_led(struct hda_codec *codec, const struct hda_fixup *fix, int action); +int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec, + int (*callback)(struct led_classdev *, + enum led_brightness)); #endif /* __SOUND_HDA_GENERIC_H */ -- cgit From 5fc0f6930035c5ef30f1a869e6450854618b29d7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 18 Jun 2020 13:08:35 +0200 Subject: ALSA: hda: generic: Drop unused snd_hda_gen_fixup_micmute_led() The fixup function is no longer used. Let's drop. Tested-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200618110842.27238-7-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'sound/pci/hda/hda_generic.h') diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index f56bc8da20b2..6fcb62ed30c6 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -357,8 +357,6 @@ int snd_hda_gen_fix_pin_power(struct hda_codec *codec, hda_nid_t pin); int snd_hda_gen_add_micmute_led(struct hda_codec *codec, void (*hook)(struct hda_codec *)); -void snd_hda_gen_fixup_micmute_led(struct hda_codec *codec, - const struct hda_fixup *fix, int action); int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec, int (*callback)(struct led_classdev *, enum led_brightness)); -- cgit From fe1a162191a59cbfd3f917e92cdb2d5de996a8a0 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 18 Jun 2020 13:08:36 +0200 Subject: ALSA: hda: generic: Drop the old mic-mute LED hook Now all users of the old snd_hda_gen_add_micmute_led() have been converted to the new LED-classdev variant, and we can make it local, and remove the unused hda_gen_spec.micmute_led.update callback field. Tested-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200618110842.27238-8-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'sound/pci/hda/hda_generic.h') diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index 6fcb62ed30c6..a59e66f9ff33 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -88,7 +88,6 @@ struct hda_micmute_hook { unsigned int led_mode; unsigned int capture; unsigned int led_value; - void (*update)(struct hda_codec *codec); void (*old_hook)(struct hda_codec *codec, struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); @@ -355,8 +354,6 @@ unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec, void snd_hda_gen_stream_pm(struct hda_codec *codec, hda_nid_t nid, bool on); int snd_hda_gen_fix_pin_power(struct hda_codec *codec, hda_nid_t pin); -int snd_hda_gen_add_micmute_led(struct hda_codec *codec, - void (*hook)(struct hda_codec *)); int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec, int (*callback)(struct led_classdev *, enum led_brightness)); -- cgit From 15509b6344726de22bdbfff88b65341dd0dd33af Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 18 Jun 2020 13:08:37 +0200 Subject: ALSA: hda: generic: Add vmaster mute LED helper Like mic-mute LED handling, add a new helper to deal with the master mute LED with LED classdev. Unlike the mic-mute case, the playback master mute is hooked on vmaster, and we suppose no nested hooks allowed there. The classdev creation code is factored out to a common function that is called from both mute and mic-mute LED helpers. Tested-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20200618110842.27238-9-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound/pci/hda/hda_generic.h') diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index a59e66f9ff33..bbd6d2b741f2 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -354,6 +354,9 @@ unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec, void snd_hda_gen_stream_pm(struct hda_codec *codec, hda_nid_t nid, bool on); int snd_hda_gen_fix_pin_power(struct hda_codec *codec, hda_nid_t pin); +int snd_hda_gen_add_mute_led_cdev(struct hda_codec *codec, + int (*callback)(struct led_classdev *, + enum led_brightness)); int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec, int (*callback)(struct led_classdev *, enum led_brightness)); -- cgit From 9ab0cb309e7950a1649bffade985e7ccc7aaf675 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 17 Jul 2020 17:45:17 +0200 Subject: ALSA: Replace the word "slave" in vmaster API Follow the recent inclusive terminology guidelines and replace the word "slave" in vmaster API. I chose the word "follower" at this time since it seems fitting for the purpose. Note that the word "master" is kept in API, since it refers rather to audio master volume control. Also, while we're at it, a typo in comments is corrected, too. Link: https://lore.kernel.org/r/20200717154517.27599-1-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/pci/hda/hda_generic.h') diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index bbd6d2b741f2..a43f0bb77dae 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -116,7 +116,7 @@ struct hda_gen_spec { * dig_out_nid and hp_nid are optional */ hda_nid_t alt_dac_nid; - hda_nid_t slave_dig_outs[3]; /* optional - for auto-parsing */ + hda_nid_t follower_dig_outs[3]; /* optional - for auto-parsing */ int dig_out_type; /* capture */ -- cgit