]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SDCA: fix HID dependency
authorArnd Bergmann <arnd@arndb.de>
Wed, 9 Jul 2025 15:24:17 +0000 (17:24 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 9 Jul 2025 15:42:22 +0000 (16:42 +0100)
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>
Link: https://patch.msgid.link/20250709152430.1498427-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdca/Kconfig
sound/soc/sdca/Makefile

index 53f6926255ae3f3b60ef413e13100e32d9d2fe43..2253a300dcc35f1c8b4719ed5740d94a91003d1e 100644 (file)
@@ -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
index 2a3938d11ca9090fa7276ade2a923c89f9db45dd..1efc869c6cbc3827384098392b890b5167fed262 100644 (file)
@@ -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