All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
Subject: [PATCH 05/13] ALSA: hda/sigmatel: Convert to cdev-variant of mic-mute LED controls
Date: Thu, 18 Jun 2020 13:08:34 +0200	[thread overview]
Message-ID: <20200618110842.27238-6-tiwai@suse.de> (raw)
In-Reply-To: <20200618110842.27238-1-tiwai@suse.de>

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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/patch_sigmatel.c | 9 ++++++---
 1 file 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);
 	}
 }
 
-- 
2.16.4


  parent reply	other threads:[~2020-06-18 11:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 11:08 [PATCH 00/13] ALSA: hda: Use LED classdev for mute controls consistently Takashi Iwai
2020-06-18 11:08 ` [PATCH 01/13] ALSA: hda: generic: Always call led-trigger for mic mute LED Takashi Iwai
2020-06-18 11:08 ` [PATCH 02/13] ALSA: hda: generic: Add a helper for mic-mute LED with LED classdev Takashi Iwai
2020-06-18 11:08 ` [PATCH 03/13] ALSA: hda/realtek: Convert to cdev-variant of mic-mute LED controls Takashi Iwai
2020-06-18 11:08 ` [PATCH 04/13] ALSA: hda/conexant: " Takashi Iwai
2020-06-18 11:08 ` Takashi Iwai [this message]
2020-06-18 11:08 ` [PATCH 06/13] ALSA: hda: generic: Drop unused snd_hda_gen_fixup_micmute_led() Takashi Iwai
2020-06-18 11:08 ` [PATCH 07/13] ALSA: hda: generic: Drop the old mic-mute LED hook Takashi Iwai
2020-06-18 11:08 ` [PATCH 08/13] ALSA: hda: generic: Add vmaster mute LED helper Takashi Iwai
2020-06-18 11:08 ` [PATCH 09/13] ALSA: hda/realtek: Use the new " Takashi Iwai
2020-06-18 11:08 ` [PATCH 10/13] ALSA: hda/conexant: " Takashi Iwai
2020-06-18 11:08 ` [PATCH 11/13] ALSA: hda/sigmatel: " Takashi Iwai
2020-06-18 11:08 ` [PATCH 12/13] ALSA: hda/realtek: Unify LED helper code Takashi Iwai
2020-06-18 11:08 ` [PATCH 13/13] ALSA: hda: Let LED cdev handling suspend/resume Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200618110842.27238-6-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.heng.feng@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.