summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-03-12 16:59:58 +0100
committerTakashi Iwai <tiwai@suse.de>2012-03-13 07:46:50 +0100
commitd2f344b5e0a933b5b1d12f863406ee1d63e5bf8e (patch)
tree3e7354efd8293fa6b1d6e24ddcd3c2356dafb2ba /sound/pci/hda/patch_realtek.c
parent527c73bada6f02a35983ddb34db3a0fd4360c88c (diff)
ALSA: hda - Add "Mute-LED Mode" enum control
Create snd_hda_add_vmaster_hook() and snd_hda_sync_vmaster_hook() helper functions to handle the mute-LED in vmaster hook more commonly. In the former function, a new enum control "Mute-LED Mode" is added. This provides user to choose whether the mute-LED should be turned on/off explicitly or to follow the master-mute status. Reviewed-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 901547216c4..b69d2fe4029 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -198,7 +198,7 @@ struct alc_spec {
/* for virtual master */
hda_nid_t vmaster_nid;
- struct snd_kcontrol *vmaster_sw_kctl;
+ struct hda_vmaster_mute_hook vmaster_mute;
#ifdef CONFIG_SND_HDA_POWER_SAVE
struct hda_loopback_check loopback;
int num_loopbacks;
@@ -1960,7 +1960,7 @@ static int __alc_build_controls(struct hda_codec *codec)
err = __snd_hda_add_vmaster(codec, "Master Playback Switch",
NULL, alc_slave_pfxs,
"Playback Switch",
- true, &spec->vmaster_sw_kctl);
+ true, &spec->vmaster_mute.sw_kctl);
if (err < 0)
return err;
}
@@ -5894,13 +5894,11 @@ static void alc269_fixup_mic2_mute(struct hda_codec *codec,
struct alc_spec *spec = codec->spec;
switch (action) {
case ALC_FIXUP_ACT_BUILD:
- if (!spec->vmaster_sw_kctl)
- return;
- snd_ctl_add_vmaster_hook(spec->vmaster_sw_kctl,
- alc269_fixup_mic2_mute_hook, codec);
+ spec->vmaster_mute.hook = alc269_fixup_mic2_mute_hook;
+ snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute);
/* fallthru */
case ALC_FIXUP_ACT_INIT:
- snd_ctl_sync_vmaster_hook(spec->vmaster_sw_kctl);
+ snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
break;
}
}