summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-06-18 13:08:33 +0200
committerTakashi Iwai <tiwai@suse.de>2020-06-18 13:23:01 +0200
commite65a2caf3b05d616adf3bdd83e3581bbdced5d82 (patch)
tree2970af2faccfb45485da1b03b98b664efb6df732
parent8a503555be4647bfa5312db4dd622a357492beb7 (diff)
ALSA: hda/conexant: Convert to cdev-variant of mic-mute LED controls
This patch converts the remaining user of snd_hda_gen_add_micmute_led() in Conexant codec driver into the new snd_hda_gen_add_micmute_led_cdev(). Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_conexant.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 396b5503038a..5a7c16e39d7a 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -640,12 +640,14 @@ 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_gpio_micmute_update(struct hda_codec *codec)
+static int cxt_gpio_micmute_update(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
{
+ struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
struct conexant_spec *spec = codec->spec;
- cxt_update_gpio_led(codec, spec->gpio_mic_led_mask,
- spec->gen.micmute_led.led_value);
+ cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, brightness);
+ return 0;
}
@@ -665,7 +667,7 @@ static void cxt_fixup_mute_led_gpio(struct hda_codec *codec,
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_gen_add_micmute_led_cdev(codec, cxt_gpio_micmute_update);
}
snd_hda_add_verbs(codec, gpio_init);
if (spec->gpio_led)