diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-03-12 16:59:58 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-03-13 07:46:50 +0100 |
commit | d2f344b5e0a933b5b1d12f863406ee1d63e5bf8e (patch) | |
tree | 3e7354efd8293fa6b1d6e24ddcd3c2356dafb2ba /sound/pci/hda/patch_sigmatel.c | |
parent | 527c73bada6f02a35983ddb34db3a0fd4360c88c (diff) | |
download | op-kernel-dev-d2f344b5e0a933b5b1d12f863406ee1d63e5bf8e.zip op-kernel-dev-d2f344b5e0a933b5b1d12f863406ee1d63e5bf8e.tar.gz |
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_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 6e92649..cd04e29 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -311,7 +311,7 @@ struct sigmatel_spec { unsigned auto_dmic_cnt; hda_nid_t auto_dmic_nids[MAX_DMICS_NUM]; - struct snd_kcontrol *vmaster_sw_kctl; + struct hda_vmaster_mute_hook vmaster_mute; }; static const hda_nid_t stac9200_adc_nids[1] = { @@ -1160,14 +1160,15 @@ static int stac92xx_build_controls(struct hda_codec *codec) err = __snd_hda_add_vmaster(codec, "Master Playback Switch", NULL, slave_pfxs, "Playback Switch", true, - &spec->vmaster_sw_kctl); + &spec->vmaster_mute.sw_kctl); if (err < 0) return err; if (spec->gpio_led) { - snd_ctl_add_vmaster_hook(spec->vmaster_sw_kctl, - stac92xx_vmaster_hook, codec); - snd_ctl_sync_vmaster_hook(spec->vmaster_sw_kctl); + spec->vmaster_mute.hook = stac92xx_vmaster_hook; + err = snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute); + if (err < 0) + return err; } if (spec->aloopback_ctl && @@ -4432,7 +4433,7 @@ static int stac92xx_init(struct hda_codec *codec) snd_hda_jack_report_sync(codec); /* sync mute LED */ - snd_ctl_sync_vmaster_hook(spec->vmaster_sw_kctl); + snd_hda_sync_vmaster_hook(&spec->vmaster_mute); if (spec->dac_list) stac92xx_power_down(codec); return 0; |