linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [v2] ASoC: SDCA: fix HID dependency
@ 2025-07-09 15:24 Arnd Bergmann
  2025-07-10  8:20 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2025-07-09 15:24 UTC (permalink / raw)
  To: Charles Keepax, Maciej Strozek, Liam Girdwood, Mark Brown,
	Shuming Fan
  Cc: Arnd Bergmann, Bard Liao, Pierre-Louis Bossart, Jaroslav Kysela,
	Takashi Iwai, Péter Ujfalusi, Kuninori Morimoto, linux-sound,
	patches, linux-kernel

From: Arnd Bergmann <arnd@arndb.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")
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: small simplification suggested by Charles
---
 sound/soc/sdca/Kconfig  | 5 +++--
 sound/soc/sdca/Makefile | 4 +++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sdca/Kconfig b/sound/soc/sdca/Kconfig
index 53f6926255ae..2253a300dcc3 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"
-	depends on SND_SOC_SDCA && HID
+	bool "SDCA HID support"
+	depends on SND_SOC_SDCA
+	depends on HID=y || HID=SND_SOC_SDCA
 
 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
 obj-$(CONFIG_SND_SOC_SDCA_IRQ)	+= snd-soc-sdca-irq.o
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-10  8:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 15:24 [PATCH] [v2] ASoC: SDCA: fix HID dependency Arnd Bergmann
2025-07-10  8:20 ` Mark Brown

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).