public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: wm_adsp: select CONFIG_SND_SOC_WM_ADSP from all users
@ 2026-03-20 15:17 Arnd Bergmann
  2026-03-23  9:57 ` Richard Fitzgerald
  2026-03-23 14:37 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-03-20 15:17 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Richard Fitzgerald
  Cc: Arnd Bergmann, Srinivas Kandagatla, ChiYuan Huang, Zhang Yi,
	linux-sound, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The addition of the kunit test made it possible to enable the WM_ADSP
driver even when there are no users. However, an unintended side-effect
was that it is also possible to turn it off when it is actually required,
leading to build failures:

ERROR: modpost: "wm_halo_init" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined!
ERROR: modpost: "wm_adsp2_remove" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined!
ERROR: modpost: "wm_adsp_hibernate" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined!
ERROR: modpost: "wm_adsp2_component_probe" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined!

Reverse the logic to replace the ununual list of 'default y if ....' with
the regular 'select' that do the same thing but prevent it from being
disabled if that would break the build.

Fixes: bf2d44d07de7 ("ASoC: wm_adsp: Add kunit test for firmware file search")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/codecs/Kconfig | 31 +++++++++----------------------
 1 file changed, 9 insertions(+), 22 deletions(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index f9e6a83e55c6..d6104796db4f 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -401,28 +401,6 @@ config SND_SOC_WM_ADSP
 	tristate "Cirrus Logic wm_adsp driver" if KUNIT
 	select FW_CS_DSP
 	select SND_SOC_COMPRESS
-	default y if SND_SOC_MADERA=y
-	default y if SND_SOC_CS47L24=y
-	default y if SND_SOC_WM5102=y
-	default y if SND_SOC_WM5110=y
-	default y if SND_SOC_WM2200=y
-	default y if SND_SOC_CS35L41_SPI=y
-	default y if SND_SOC_CS35L41_I2C=y
-	default y if SND_SOC_CS35L45_SPI=y
-	default y if SND_SOC_CS35L45_I2C=y
-	default y if SND_SOC_CS35L56=y
-	default y if SND_SOC_CS48L32=y
-	default m if SND_SOC_MADERA=m
-	default m if SND_SOC_CS47L24=m
-	default m if SND_SOC_WM5102=m
-	default m if SND_SOC_WM5110=m
-	default m if SND_SOC_WM2200=m
-	default m if SND_SOC_CS35L41_SPI=m
-	default m if SND_SOC_CS35L41_I2C=m
-	default m if SND_SOC_CS35L45_SPI=m
-	default m if SND_SOC_CS35L45_I2C=m
-	default m if SND_SOC_CS35L56=m
-	default m if SND_SOC_CS48L32=m
 
 config SND_SOC_WM_ADSP_TEST
 	tristate "KUnit tests for Cirrus Logic wm_adsp" if !KUNIT_ALL_TESTS
@@ -834,6 +812,7 @@ config SND_SOC_CS35L41_LIB
 
 config SND_SOC_CS35L41
 	tristate
+	select SND_SOC_WM_ADSP
 
 config SND_SOC_CS35L41_SPI
 	tristate "Cirrus Logic CS35L41 CODEC (SPI)"
@@ -852,6 +831,7 @@ config SND_SOC_CS35L41_I2C
 config SND_SOC_CS35L45
 	tristate
 	select REGMAP_IRQ
+	select SND_SOC_WM_ADSP
 
 config SND_SOC_CS35L45_SPI
 	tristate "Cirrus Logic CS35L45 CODEC (SPI)"
@@ -875,6 +855,7 @@ config SND_SOC_CS35L45_I2C
 
 config SND_SOC_CS35L56
 	tristate
+	select SND_SOC_WM_ADSP
 
 config SND_SOC_CS35L56_SHARED
 	select SND_SOC_CS_AMP_LIB
@@ -1112,6 +1093,7 @@ config SND_SOC_CS47L15
 config SND_SOC_CS47L24
 	tristate
 	depends on MFD_CS47L24 && MFD_ARIZONA
+	select SND_SOC_WM_ADSP
 
 config SND_SOC_CS47L35
 	tristate
@@ -1133,6 +1115,7 @@ config SND_SOC_CS48L32
 	tristate "Cirrus Logic CS48L32 audio DSP"
 	depends on SPI_MASTER
 	select REGMAP_SPI
+	select SND_SOC_WM_ADSP
 	help
 	  Build the codec driver for the Cirrus Logic CS48L32 audio DSP.
 
@@ -1391,6 +1374,7 @@ config SND_SOC_LOCHNAGAR_SC
 
 config SND_SOC_MADERA
 	tristate
+	select SND_SOC_WM_ADSP
 	default y if SND_SOC_CS47L15=y
 	default y if SND_SOC_CS47L35=y
 	default y if SND_SOC_CS47L85=y
@@ -2489,6 +2473,7 @@ config SND_SOC_WM2000
 config SND_SOC_WM2200
 	tristate
 	depends on I2C
+	select SND_SOC_WM_ADSP
 
 config SND_SOC_WM5100
 	tristate
@@ -2497,10 +2482,12 @@ config SND_SOC_WM5100
 config SND_SOC_WM5102
 	tristate
 	depends on MFD_WM5102 && MFD_ARIZONA
+	select SND_SOC_WM_ADSP
 
 config SND_SOC_WM5110
 	tristate
 	depends on MFD_WM5110 && MFD_ARIZONA
+	select SND_SOC_WM_ADSP
 
 config SND_SOC_WM8350
 	tristate
-- 
2.39.5


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

* Re: [PATCH] ASoC: wm_adsp: select CONFIG_SND_SOC_WM_ADSP from all users
  2026-03-20 15:17 [PATCH] ASoC: wm_adsp: select CONFIG_SND_SOC_WM_ADSP from all users Arnd Bergmann
@ 2026-03-23  9:57 ` Richard Fitzgerald
  2026-03-23 14:37 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2026-03-23  9:57 UTC (permalink / raw)
  To: Arnd Bergmann, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: Arnd Bergmann, Srinivas Kandagatla, ChiYuan Huang, Zhang Yi,
	linux-sound, linux-kernel

On 20/03/2026 3:17 pm, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The addition of the kunit test made it possible to enable the WM_ADSP
> driver even when there are no users. However, an unintended side-effect
> was that it is also possible to turn it off when it is actually required,
> leading to build failures:

Sorry, I never thought of people intentionally disabling it just
because they can in a KUnit build.

> Reverse the logic to replace the ununual list of 'default y if ....' with
> the regular 'select' that do the same thing but prevent it from being
> disabled if that would break the build.

The unusual defaulting is because old kernels didn't support nested
selects. So when the machine driver selected the codec driver, any
selects in the codec driver would be ignored. The defaults were a
workaround.

> 
> Fixes: bf2d44d07de7 ("ASoC: wm_adsp: Add kunit test for firmware file search")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>


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

* Re: [PATCH] ASoC: wm_adsp: select CONFIG_SND_SOC_WM_ADSP from all users
  2026-03-20 15:17 [PATCH] ASoC: wm_adsp: select CONFIG_SND_SOC_WM_ADSP from all users Arnd Bergmann
  2026-03-23  9:57 ` Richard Fitzgerald
@ 2026-03-23 14:37 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-03-23 14:37 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Richard Fitzgerald,
	Arnd Bergmann
  Cc: Arnd Bergmann, Srinivas Kandagatla, ChiYuan Huang, Zhang Yi,
	linux-sound, linux-kernel

On Fri, 20 Mar 2026 16:17:31 +0100, Arnd Bergmann wrote:
> ASoC: wm_adsp: select CONFIG_SND_SOC_WM_ADSP from all users

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1

Thanks!

[1/1] ASoC: wm_adsp: select CONFIG_SND_SOC_WM_ADSP from all users
      https://git.kernel.org/broonie/sound/c/e3f1ce073a0d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2026-03-24  0:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 15:17 [PATCH] ASoC: wm_adsp: select CONFIG_SND_SOC_WM_ADSP from all users Arnd Bergmann
2026-03-23  9:57 ` Richard Fitzgerald
2026-03-23 14:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox