Commit 514b2262 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Sudeep Holla
Browse files

firmware: arm_scmi: Fix i.MX build dependency



The newly added SCMI vendor driver references functions in the
protocol driver but needs a Kconfig dependency to ensure it can link,
essentially the Kconfig dependency needs to be reversed to match the
link time dependency:

  |  arm-linux-gnueabi-ld: sound/soc/fsl/fsl_mqs.o: in function `fsl_mqs_sm_write':
  |  	fsl_mqs.c:(.text+0x1aa): undefined reference to `scmi_imx_misc_ctrl_set'
  |  arm-linux-gnueabi-ld: sound/soc/fsl/fsl_mqs.o: in function `fsl_mqs_sm_read':
  |  	fsl_mqs.c:(.text+0x1ee): undefined reference to `scmi_imx_misc_ctrl_get'

This however only works after changing the dependency in the SND_SOC_FSL_MQS
driver as well, which uses 'select IMX_SCMI_MISC_DRV' to turn on a
driver it depends on. This is generally a bad idea, so the best solution
is to change that into a dependency.

To allow the ASoC driver to keep building with the SCMI support, this
needs to be an optional dependency that enforces the link-time
dependency if IMX_SCMI_MISC_DRV is a loadable module but not
depend on it if that is disabled.

Fixes: 61c9f03e ("firmware: arm_scmi: Add initial support for i.MX MISC protocol")
Fixes: 101c9023 ("ASoC: fsl_mqs: Support accessing registers by scmi interface")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarShengjiu Wang <shengjiu.wang@gmail.com>
Message-Id: <20241115230555.2435004-1-arnd@kernel.org>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 40384c84
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ config IMX_SCMI_BBM_EXT
config IMX_SCMI_MISC_EXT
	tristate "i.MX SCMI MISC EXTENSION"
	depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
	depends on IMX_SCMI_MISC_DRV
	default y if ARCH_MXC
	help
	  This enables i.MX System MISC control logic such as gpio expander
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ config IMX_SCU

config IMX_SCMI_MISC_DRV
	tristate "IMX SCMI MISC Protocol driver"
	depends on IMX_SCMI_MISC_EXT || COMPILE_TEST
	default y if ARCH_MXC
	help
	  The System Controller Management Interface firmware (SCMI FW) is
+1 −1
Original line number Diff line number Diff line
@@ -29,8 +29,8 @@ config SND_SOC_FSL_SAI
config SND_SOC_FSL_MQS
	tristate "Medium Quality Sound (MQS) module support"
	depends on SND_SOC_FSL_SAI
	depends on IMX_SCMI_MISC_DRV || !IMX_SCMI_MISC_DRV
	select REGMAP_MMIO
	select IMX_SCMI_MISC_DRV if IMX_SCMI_MISC_EXT !=n
	help
	  Say Y if you want to add Medium Quality Sound (MQS)
	  support for the Freescale CPUs.