[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aG5iwy6j3rR0YdPy@opensource.cirrus.com>
Date: Wed, 9 Jul 2025 13:38:27 +0100
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Maciej Strozek <mstrozek@...nsource.cirrus.com>,
Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Shuming Fan <shumingf@...ltek.com>, Arnd Bergmann <arnd@...db.de>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.dev>,
Péter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
linux-sound@...r.kernel.org, patches@...nsource.cirrus.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: SDCA: fix HID dependency
On Tue, Jul 08, 2025 at 08:46:06PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> It is not possible to enable SND_SOC_SDCA_HID when SND_SOC_SDCA is built-in
> but HID is in a loadable module, as that results in a link failure:
>
> x86_64-linux-ld: sound/soc/sdca/sdca_functions.o: in function `find_sdca_entity_hide':
> sdca_functions.c:(.text+0x25b): undefined reference to `sdca_add_hid_device'
>
> Change SND_SOC_SDCA_HID into a 'bool' option that can only be enabled
> if this results in a working build, and change the Makefile so this driver
> is a loadable module if possible.
>
> Fixes: ac558015dfd8 ("ASoC: SDCA: add a HID device for HIDE entity")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
Thanks for spotting this.
> sound/soc/sdca/Kconfig | 3 ++-
> sound/soc/sdca/Makefile | 4 +++-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/sdca/Kconfig b/sound/soc/sdca/Kconfig
> index 53f6926255ae..36c2fed54dad 100644
> --- a/sound/soc/sdca/Kconfig
> +++ b/sound/soc/sdca/Kconfig
> @@ -12,8 +12,9 @@ config SND_SOC_SDCA_OPTIONAL
> def_tristate SND_SOC_SDCA || !SND_SOC_SDCA
>
> config SND_SOC_SDCA_HID
> - tristate "SDCA HID support"
> + bool "SDCA HID support"
> depends on SND_SOC_SDCA && HID
> + depends on HID=y || HID=SND_SOC_SDCA
Does it perhaps make more sense to add a (HID || !HID) dependency
on SND_SOC_SDCA and leave the dependencies here alone? I feel
like that lets the Kconfig figure out the right settings for
SND_SOC_SDCA automatically, rather than just disappearing the SDCA
HID option when HID and SDCA are set incompatibly.
>
> config SND_SOC_SDCA_IRQ
> tristate
> diff --git a/sound/soc/sdca/Makefile b/sound/soc/sdca/Makefile
> index 2a3938d11ca9..1efc869c6cbc 100644
> --- a/sound/soc/sdca/Makefile
> +++ b/sound/soc/sdca/Makefile
> @@ -5,5 +5,7 @@ snd-soc-sdca-hid-y := sdca_hid.o
> snd-soc-sdca-irq-y := sdca_interrupts.o
>
> obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca.o
> -obj-$(CONFIG_SND_SOC_SDCA_HID) += snd-soc-sdca-hid.o
> +ifdef CONFIG_SND_SOC_SDCA_HID
> +obj-$(CONFIG_SND_SOC_SDCA) += snd-soc-sdca-hid.o
> +endif
Yeah I think making HID more of an option on the module rather
than a module in its own right makes a lot of sense.
We should probably do something similar with the IRQ stuff I will
look at doing a patch for that once we have sorted this one.
Thanks,
Charles
Powered by blists - more mailing lists