aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai2013-01-14 12:36:18 +0100
committerTakashi Iwai2013-01-14 12:36:18 +0100
commitac06e2298d42ea13cc5da03842a63b4eed342004 (patch)
tree0044c349b7890e448b25f16c767301801bfffe19 /sound/pci/hda
parentb3f6008f2d511133e0f04782c437a13b6865d26b (diff)
parentae177c3fd0667df21b60bc8e031607de257e58e4 (diff)
Merge branch 'test/hda-gen-parser' into test/hda-migrate
* test/hda-gen-parser: ALSA: hda - Add capture_switch_hook to generic parser
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_generic.c16
-rw-r--r--sound/pci/hda/hda_generic.h3
2 files changed, 18 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 = {
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index bfa2d973268b..1ceaacd1b775 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -227,6 +227,9 @@ struct hda_gen_spec {
struct hda_jack_tbl *tbl);
void (*mic_autoswitch_hook)(struct hda_codec *codec,
struct hda_jack_tbl *tbl);
+
+ /* capture switch hook (for mic-mute LED) */
+ void (*capture_switch_hook)(struct hda_codec *codec, bool enable);
};
int snd_hda_gen_spec_init(struct hda_gen_spec *spec);