diff options
author | Takashi Iwai <tiwai@suse.de> | 2020-06-18 13:08:34 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2020-06-18 13:23:10 +0200 |
commit | 23a2b46966bde1e54a7b67e4968554905d71cad5 (patch) | |
tree | 0a2b32f9c6a03eec5b27a9e86d2ee7d732338ebe | |
parent | e65a2caf3b05d616adf3bdd83e3581bbdced5d82 (diff) | |
download | linux-23a2b46966bde1e54a7b67e4968554905d71cad5.tar.bz2 |
ALSA: hda/sigmatel: Convert to cdev-variant of mic-mute LED controls
This patch converts the remaining user of
snd_hda_gen_add_micmute_led() in IDT/Sigmatel 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-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index a608d0486ae4..3b796d0d7a67 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -320,15 +320,18 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, } /* hook for controlling mic-mute LED GPIO */ -static void stac_capture_led_update(struct hda_codec *codec) +static int stac_capture_led_update(struct led_classdev *led_cdev, + enum led_brightness brightness) { + struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); struct sigmatel_spec *spec = codec->spec; - if (spec->gen.micmute_led.led_value) + if (brightness) spec->gpio_data |= spec->mic_mute_led_gpio; else spec->gpio_data &= ~spec->mic_mute_led_gpio; stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); + return 0; } static int stac_vrefout_set(struct hda_codec *codec, @@ -4636,7 +4639,7 @@ static void stac_setup_gpio(struct hda_codec *codec) spec->gpio_dir |= spec->mic_mute_led_gpio; spec->mic_enabled = 0; spec->gpio_data |= spec->mic_mute_led_gpio; - snd_hda_gen_add_micmute_led(codec, stac_capture_led_update); + snd_hda_gen_add_micmute_led_cdev(codec, stac_capture_led_update); } } |