]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - sound/pci/hda/patch_sigmatel.c
ALSA: hda - Consolidate cap_sync_hook and capture_switch_hook
[mirror_ubuntu-bionic-kernel.git] / sound / pci / hda / patch_sigmatel.c
index 9d2dfad7f0bcecde1c6c99c181bc37c7aa03281d..456ebc771313f4954f787027992bc806639c541d 100644 (file)
@@ -316,11 +316,17 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
 }
 
 /* hook for controlling mic-mute LED GPIO */
-static void stac_capture_led_hook(struct hda_codec *codec, bool enable)
+static void stac_capture_led_hook(struct hda_codec *codec,
+                              struct snd_ctl_elem_value *ucontrol)
 {
        struct sigmatel_spec *spec = codec->spec;
-       bool mute = !enable;
+       bool mute;
 
+       if (!ucontrol)
+               return;
+
+       mute = !(ucontrol->value.integer.value[0] ||
+                ucontrol->value.integer.value[1]);
        if (spec->mic_mute_led_on != mute) {
                spec->mic_mute_led_on = mute;
                if (mute)
@@ -3806,7 +3812,7 @@ static void stac_setup_gpio(struct hda_codec *codec)
                spec->mic_mute_led_on = true;
                spec->gpio_data |= spec->mic_mute_led_gpio;
 
-               spec->gen.capture_switch_hook = stac_capture_led_hook;
+               spec->gen.cap_sync_hook = stac_capture_led_hook;
        }
 }