ALSA: hda - Add expose_enum_ctl flag to snd_hda_add_vmaster_hook()
Since it's not always safe to assume that the vmaster hook is purely the
mute-LED control, add the flag indicating whether to expose the mute-LED
enum control or not. Currently, conexant codec sets this off for non-HP
laptops where EAPD may be used really as EAPD.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b981ea9..7a8fcc4 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2508,7 +2508,8 @@
* the given hook.
*/
int snd_hda_add_vmaster_hook(struct hda_codec *codec,
- struct hda_vmaster_mute_hook *hook)
+ struct hda_vmaster_mute_hook *hook,
+ bool expose_enum_ctl)
{
struct snd_kcontrol *kctl;
@@ -2517,6 +2518,8 @@
snd_ctl_add_vmaster_hook(hook->sw_kctl, hook->hook, codec);
hook->codec = codec;
hook->mute_mode = HDA_VMUTE_FOLLOW_MASTER;
+ if (!expose_enum_ctl)
+ return 0;
kctl = snd_ctl_new1(&vmaster_mute_mode, hook);
if (!kctl)
return -ENOMEM;