summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-14 12:13:06 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-14 12:13:06 +0100
commitae177c3fd0667df21b60bc8e031607de257e58e4 (patch)
tree8ad4b7163899a2f317b7647b3060af6de1d9790d /sound/pci/hda/hda_generic.c
parent8fadf1da3f370dacbeb4c30fd015a6d2cc47f2fa (diff)
ALSA: hda - Add capture_switch_hook to generic parser
Add a hook for the capture mixer switch. This will be used by IDT codecs for controlling the mic-mute LED. 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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 4bc4cd933866..932e6a133f3d 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -2517,9 +2517,23 @@ static const struct snd_kcontrol_new cap_vol_temp = {
static int cap_sw_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- return cap_put_caller(kcontrol, ucontrol,
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct hda_gen_spec *spec = codec->spec;
+ int ret;
+
+ ret = cap_put_caller(kcontrol, ucontrol,
snd_hda_mixer_amp_switch_put,
NID_PATH_MUTE_CTL);
+ if (ret < 0)
+ return ret;
+
+ if (spec->capture_switch_hook) {
+ bool enable = (ucontrol->value.integer.value[0] ||
+ ucontrol->value.integer.value[1]);
+ spec->capture_switch_hook(codec, enable);
+ }
+
+ return ret;
}
static const struct snd_kcontrol_new cap_sw_temp = {