Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp314743pxu; Wed, 14 Oct 2020 01:56:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoQcquQ4Ic2H7PjnBSOOolPNr0EVROe7Ml/JV7Q74MaqapzeLIDhZB6Gp8IdS4YIhgv2Ff X-Received: by 2002:a05:6402:187:: with SMTP id r7mr3920285edv.360.1602665766736; Wed, 14 Oct 2020 01:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602665766; cv=none; d=google.com; s=arc-20160816; b=pId1GRJ734xTzpbBu5Ee4YbiPP0jXVp+6LXqjAmHoMvSPMBNki7N50VeEC6PZcHXAF E4BsRYeQjOaWtESVjRcPrRUXir6uSKHfz0HxCka8B2PgJNn2qJomEBj2dKylqQtF7mJz AE6WRM9fu1A3XKPDOg5K2prrXsSddkKeUpgqZjmg+NHHhvEuMxo+bdsMh194uxXe6vcs zjPXicXni+vEGqIYyYO1/9MI/a2uYhaKDflk+fccTS1dQEkjDZy0Va2G0xrLpTXMivJe K84h8urUddXwBWNtC0eDp57GR2SeY0oO7Jsf7GpTbESFkiG6RtIzQGeFVCeJ6hXJD1MW pSkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=h9AatO2MWUyFqxR6OcjHk56UpqXlevITHQcilt8+Sc4=; b=prxG3dpM/JuNWDqpceayFvlspBR3l0/7VhuoMikyMoT890AwcpojE4I77BVONqq/Er DHY3eHMVyzAplTVUYFywpITEoLj+79rFM030KSGKaj8FOulacBRU+jjNi8Of+SvAaGsr WaR/qFijCJ5dKSLy7rNOma6KqvkkvKwiiCooqgMKA+SXqJ2mLTK7Am1Im+2zIp0Cet+8 bPXqTnea5bsSR9iVni7sLKAYvAOAKOdLrp3EKIYHOuLmURQQEJEHUfl8/tIsbrPzScpm Gd0WnBQhcjO4OT0L7ebS9uU31A21yMh1LymNplT3uYiSxJZUxsbqWmLkrWYFv7f4tp3Q ii8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id li15si1837544ejb.166.2020.10.14.01.55.44; Wed, 14 Oct 2020 01:56:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727910AbgJNHvs (ORCPT + 99 others); Wed, 14 Oct 2020 03:51:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:59584 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727833AbgJNHvs (ORCPT ); Wed, 14 Oct 2020 03:51:48 -0400 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 BA45DAF4C; Wed, 14 Oct 2020 07:51:46 +0000 (UTC) Date: Wed, 14 Oct 2020 09:51:46 +0200 Message-ID: From: Takashi Iwai To: Randy Dunlap Cc: Udo van den Heuvel , "linux-kernel@vger.kernel.org" , linux-leds@vger.kernel.org, Dan Murphy , Pavel Machek , moderated for non-subscribers 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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 */