Commit e65a2caf authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200618110842.27238-5-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8a503555
...@@ -640,12 +640,14 @@ static void cxt_fixup_gpio_mute_hook(void *private_data, int enabled) ...@@ -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 */ /* 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; struct conexant_spec *spec = codec->spec;
cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, brightness);
spec->gen.micmute_led.led_value); return 0;
} }
...@@ -665,7 +667,7 @@ static void cxt_fixup_mute_led_gpio(struct hda_codec *codec, ...@@ -665,7 +667,7 @@ static void cxt_fixup_mute_led_gpio(struct hda_codec *codec,
spec->mute_led_polarity = 0; spec->mute_led_polarity = 0;
spec->gpio_mute_led_mask = 0x01; spec->gpio_mute_led_mask = 0x01;
spec->gpio_mic_led_mask = 0x02; 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); snd_hda_add_verbs(codec, gpio_init);
if (spec->gpio_led) if (spec->gpio_led)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment