From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89CE6C433DF for ; Wed, 14 Oct 2020 07:50:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 046AF21527 for ; Wed, 14 Oct 2020 07:50:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="EIpyThHr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 046AF21527 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 236D11705; Wed, 14 Oct 2020 09:50:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 236D11705 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602661850; bh=3qvM+dBYcC9GfkJax/mSAy4NGE46q41i+6fK20MorTU=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EIpyThHrP3iwtmz/GIFxX9w7sgci3Dddc9+EvNFIyauHXeZeDxUgvHHs3gkUxxOp0 +g+sFdG03QqkH4h2bUbT6Ww/7f0D0/f9Jw+hDYdPgAjUFdrPi4A9XDIHlqt+DzSxSI aLnb5H/iMb7SXCWs/Ifoh+fNE2knYN0T+P4IPQB4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AA83CF80118; Wed, 14 Oct 2020 09:49:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A8A9EF80217; Wed, 14 Oct 2020 09:49:57 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8A4F7F80118 for ; Wed, 14 Oct 2020 09:49:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8A4F7F80118 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4389AAD46; Wed, 14 Oct 2020 07:49:50 +0000 (UTC) Date: Wed, 14 Oct 2020 09:49:49 +0200 Message-ID: From: Takashi Iwai To: Randy Dunlap Subject: Re: disabling CONFIG_LED_CLASS (SND_HDA_CODEC_REALTEK) In-Reply-To: References: <2835d02a-380b-6a3a-0e4d-abf07aee18bc@xs4all.nl> <53e698c1-86e4-8b1f-afb0-b8471349e701@xs4all.nl> <43b79598-1592-683f-46df-9e5489110780@infradead.org> <6fd1e91e-19d0-6682-dfc6-49f1cd60408b@infradead.org> <3c6d174c-30db-3d03-3d16-42df405f38d9@xs4all.nl> <58e774c5-fc80-2060-2091-9a6398582cc5@infradead.org> <9fc679e9-e9a9-ad80-b24c-f04489b98aa7@xs4all.nl> <27e159be-4376-e87b-5e60-803bc3749ec2@infradead.org> <2739e1fd-75c6-4e43-cd79-9028479f91bf@infradead.org> <1e6b1961-9e9b-5f82-86a1-bf838cb68f55@xs4all.nl> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: moderated for non-subscribers , "linux-kernel@vger.kernel.org" , Udo van den Heuvel , Dan Murphy , Pavel Machek , linux-leds@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 > 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? Takashi --- --- a/init/Kconfig +++ b/init/Kconfig @@ -1390,6 +1390,11 @@ menuconfig EXPERT environments which can tolerate a "non-standard" kernel. Only use this if you really know what you are doing. +config SUPERHACKER + bool "Rule the world" if EXPERT + help + You are allowed to break things at your own risk. + config UID16 bool "Enable 16-bit UID system calls" if EXPERT depends on HAVE_UID16 && MULTIUSER --- 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 !SUPERHACKER 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 !SUPERHACKER 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 !SUPERHACKER 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 */