summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_conexant.c
diff options
context:
space:
mode:
authorTakashi Iwai2018-06-19 12:36:36 +0200
committerTakashi Iwai2018-06-21 13:54:35 +0200
commit184e302b46c94bfb1d53fe3d4c925a45a6990430 (patch)
treedd157107ca326bc60ce175e46367ef94d2f462f3 /sound/pci/hda/patch_conexant.c
parentALSA: hda/realtek - Use the mic-mute LED helper for HP and others (diff)
downloadkernel-qcow2-linux-184e302b46c94bfb1d53fe3d4c925a45a6990430.tar.gz
kernel-qcow2-linux-184e302b46c94bfb1d53fe3d4c925a45a6990430.tar.xz
kernel-qcow2-linux-184e302b46c94bfb1d53fe3d4c925a45a6990430.zip
ALSA: hda/conexant - Use the mic-mute LED helper
Convert to use the common helper for controlling the mic mute LED for HP laptops, just as we've done for Realtek codecs. This will give the mic mute LED enum as gratis. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r--sound/pci/hda/patch_conexant.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index e7fcfc3b8885..a9fd0572d526 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -695,16 +695,12 @@ static void cxt_fixup_gpio_mute_hook(void *private_data, int enabled)
}
/* turn on/off mic-mute LED via GPIO per capture hook */
-static void cxt_fixup_gpio_mic_mute_hook(struct hda_codec *codec,
- struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+static void cxt_gpio_micmute_update(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;
- if (ucontrol)
- cxt_update_gpio_led(codec, spec->gpio_mic_led_mask,
- ucontrol->value.integer.value[0] ||
- ucontrol->value.integer.value[1]);
+ cxt_update_gpio_led(codec, spec->gpio_mic_led_mask,
+ spec->gen.micmute_led.led_value);
}
@@ -721,11 +717,11 @@ static void cxt_fixup_mute_led_gpio(struct hda_codec *codec,
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
spec->gen.vmaster_mute.hook = cxt_fixup_gpio_mute_hook;
- spec->gen.cap_sync_hook = cxt_fixup_gpio_mic_mute_hook;
spec->gpio_led = 0;
spec->mute_led_polarity = 0;
spec->gpio_mute_led_mask = 0x01;
spec->gpio_mic_led_mask = 0x02;
+ snd_hda_gen_add_micmute_led(codec, cxt_gpio_micmute_update);
}
snd_hda_add_verbs(codec, gpio_init);
if (spec->gpio_led)