alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: moderated for non-subscribers <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Udo van den Heuvel <udovdh@xs4all.nl>,
	Dan Murphy <dmurphy@ti.com>, Pavel Machek <pavel@ucw.cz>,
	linux-leds@vger.kernel.org
Subject: Re: disabling CONFIG_LED_CLASS (SND_HDA_CODEC_REALTEK)
Date: Wed, 14 Oct 2020 09:51:46 +0200	[thread overview]
Message-ID: <s5ha6wpmei5.wl-tiwai@suse.de> (raw)
In-Reply-To: <s5hblh5mele.wl-tiwai@suse.de>

On Wed, 14 Oct 2020 09:49:49 +0200,
Takashi Iwai wrote:
> 
> On Wed, 14 Oct 2020 07:54:15 +0200,
> Randy Dunlap wrote:
> > 
> > On 10/13/20 10:16 PM, Udo van den Heuvel wrote:
> > > On 14-10-2020 07:07, Randy Dunlap wrote:
> > >> On 10/13/20 9:56 PM, Udo van den Heuvel wrote:
> > > 
> > >>> I.e.: it looks like I will lose some funcionality when I disable
> > >>> SND_HDA_CODEC_REALTEK.
> > >>
> > >> OK. At present you can't have it both ways, i.e., SND_HDA_CODEC_REALTEK
> > >> with no LEDS. That driver apparently wants LEDS.
> > > 
> > > Thanks but why have I gone for years without LEDS?
> > > I do not need LEDS, I do not want LEDS, I do not have LEDS (that are
> > > visible, usable, etc).
> > > 
> > > Please make this selectable instead of forcing more bulk into my kernel.
> > > 
> > > Kind regards,
> > > Udo
> > 
> > Hi Takashi,
> > 
> > Regarding
> > commit 7cdf8c49b1df0a385db06c4f9a5ba1b16510fdcc
> > Author: Takashi Iwai <tiwai@suse.de>
> > Date:   Thu Jun 18 13:08:31 2020 +0200
> >     ALSA: hda: generic: Add a helper for mic-mute LED with LED classdev
> > 
> > and this Kconfig entry:
> > 
> > config SND_HDA_CODEC_REALTEK
> > 	tristate "Build Realtek HD-audio codec support"
> > 	select SND_HDA_GENERIC
> > 	select SND_HDA_GENERIC_LEDS
> > 
> > it seems that LED support is not always wanted (please see above).
> > I.e., user(s) would like to build a kernel without LED support at all.
> > 
> > Can you make it a build option?
> 
> Something like this?

This one is more suitable for the merge :)


Takashi

---
--- a/sound/pci/hda/Kconfig
+++ b/sound/pci/hda/Kconfig
@@ -94,7 +94,7 @@ config SND_HDA_PATCH_LOADER
 config SND_HDA_CODEC_REALTEK
 	tristate "Build Realtek HD-audio codec support"
 	select SND_HDA_GENERIC
-	select SND_HDA_GENERIC_LEDS
+	select SND_HDA_GENERIC_LEDS if !EXPERT
 	help
 	  Say Y or M here to include Realtek HD-audio codec support in
 	  snd-hda-intel driver, such as ALC880.
@@ -115,7 +115,7 @@ comment "Set to Y if you want auto-loading the codec driver"
 config SND_HDA_CODEC_SIGMATEL
 	tristate "Build IDT/Sigmatel HD-audio codec support"
 	select SND_HDA_GENERIC
-	select SND_HDA_GENERIC_LEDS
+	select SND_HDA_GENERIC_LEDS if !EXPERT
 	help
 	  Say Y or M here to include IDT (Sigmatel) HD-audio codec support in
 	  snd-hda-intel driver, such as STAC9200.
@@ -160,7 +160,7 @@ comment "Set to Y if you want auto-loading the codec driver"
 config SND_HDA_CODEC_CONEXANT
 	tristate "Build Conexant HD-audio codec support"
 	select SND_HDA_GENERIC
-	select SND_HDA_GENERIC_LEDS
+	select SND_HDA_GENERIC_LEDS if !EXPERT
 	help
 	  Say Y or M here to include Conexant HD-audio codec support in
 	  snd-hda-intel driver, such as CX20549.
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -354,11 +354,29 @@ unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
 void snd_hda_gen_stream_pm(struct hda_codec *codec, hda_nid_t nid, bool on);
 int snd_hda_gen_fix_pin_power(struct hda_codec *codec, hda_nid_t pin);
 
+#ifdef CONFIG_SND_HDA_GENERIC_LEDS
 int snd_hda_gen_add_mute_led_cdev(struct hda_codec *codec,
 				  int (*callback)(struct led_classdev *,
 						  enum led_brightness));
 int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec,
 				     int (*callback)(struct led_classdev *,
 						     enum led_brightness));
+#else /* CONFIG_SND_HDA_GENERIC_LEDS */
+static inline int
+snd_hda_gen_add_mute_led_cdev(struct hda_codec *codec,
+			      int (*callback)(struct led_classdev *,
+					      enum led_brightness))
+{
+	return -ENODEV;
+}
+
+static inline int
+snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec,
+				 int (*callback)(struct led_classdev *,
+						 enum led_brightness))
+{
+	return -ENODEV;
+}
+#endif /* CONFIG_SND_HDA_GENERIC_LEDS */
 
 #endif /* __SOUND_HDA_GENERIC_H */

  reply	other threads:[~2020-10-14  7:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2835d02a-380b-6a3a-0e4d-abf07aee18bc@xs4all.nl>
     [not found] ` <53e698c1-86e4-8b1f-afb0-b8471349e701@xs4all.nl>
     [not found]   ` <43b79598-1592-683f-46df-9e5489110780@infradead.org>
     [not found]     ` <6fd1e91e-19d0-6682-dfc6-49f1cd60408b@infradead.org>
     [not found]       ` <3c6d174c-30db-3d03-3d16-42df405f38d9@xs4all.nl>
     [not found]         ` <58e774c5-fc80-2060-2091-9a6398582cc5@infradead.org>
     [not found]           ` <9fc679e9-e9a9-ad80-b24c-f04489b98aa7@xs4all.nl>
     [not found]             ` <27e159be-4376-e87b-5e60-803bc3749ec2@infradead.org>
     [not found]               ` <eadc23e7-b383-e2fc-6e20-ed22745d0bfc@xs4all.nl>
     [not found]                 ` <2739e1fd-75c6-4e43-cd79-9028479f91bf@infradead.org>
     [not found]                   ` <1e6b1961-9e9b-5f82-86a1-bf838cb68f55@xs4all.nl>
2020-10-14  5:54                     ` disabling CONFIG_LED_CLASS (SND_HDA_CODEC_REALTEK) Randy Dunlap
2020-10-14  7:49                       ` Takashi Iwai
2020-10-14  7:51                         ` Takashi Iwai [this message]
2020-10-14  7:58                           ` Pavel Machek
2020-10-14  8:06                             ` Takashi Iwai
     [not found]                             ` <056a8933-378f-30f2-c7af-5514d93d3c36@xs4all.nl>
2020-10-14  8:11                               ` Pavel Machek
     [not found]                                 ` <2be6e184-97d4-a2b1-a500-6ea3528cff37@xs4all.nl>
2020-10-14  8:27                                   ` Pavel Machek
     [not found]                                     ` <9cf705b9-1fca-2445-43de-916b13b9103f@xs4all.nl>
2020-10-14  8:37                                       ` Pavel Machek
2020-10-19  8:35                                         ` Udo van den Heuvel
2020-10-19 10:58                                           ` Marek Behún
2020-10-14  7:54                       ` Pavel Machek
2020-10-14  8:08                         ` Takashi Iwai
2020-10-14  8:13                           ` Pavel Machek
2020-10-14  8:17                             ` 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=s5ha6wpmei5.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rdunlap@infradead.org \
    --cc=udovdh@xs4all.nl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).