From e65a2caf3b05d616adf3bdd83e3581bbdced5d82 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 18 Jun 2020 13:08:33 +0200 Subject: [PATCH] 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 Link: https://lore.kernel.org/r/20200618110842.27238-5-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_conexant.c | 10 ++++++---- 1 file 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) -- 2.11.0