Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: qcom: cleanup and fix dependency of QCOM_COMMON

SND_SOC_QCOM_COMMON depends on SOUNDWIRE for some symbols but this
is not explicitly specified using Kconfig depends. On the other hand
SND_SOC_QCOM_COMMON is also directly selected by the sound card
Kconfigs, this could result in various combinations and some symbols
ending up in modules and soundcard that uses those symbols as in-build
driver.

Fix these issues by explicitly specifying the dependencies of
SND_SOC_QCOM_COMMON and also use imply a to select SND_SOC_QCOM_COMMON
so that the symbol is selected based on its dependencies.

Also remove dummy stubs in common.c around CONFIG_SOUNDWIRE

Fixes: 3bd975f3ae0a ("ASoC: qcom: sm8250: move some code to common")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221124140351.407506-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Srinivas Kandagatla and committed by
Mark Brown
8d89cf6f 1bf5ee97

+9 -32
+9 -7
sound/soc/qcom/Kconfig
··· 2 2 menuconfig SND_SOC_QCOM 3 3 tristate "ASoC support for QCOM platforms" 4 4 depends on ARCH_QCOM || COMPILE_TEST 5 + imply SND_SOC_QCOM_COMMON 5 6 help 6 7 Say Y or M if you want to add support to use audio devices 7 8 in Qualcomm Technologies SOC-based platforms. ··· 60 59 config SND_SOC_APQ8016_SBC 61 60 tristate "SoC Audio support for APQ8016 SBC platforms" 62 61 select SND_SOC_LPASS_APQ8016 63 - select SND_SOC_QCOM_COMMON 62 + depends on SND_SOC_QCOM_COMMON 64 63 help 65 64 Support for Qualcomm Technologies LPASS audio block in 66 65 APQ8016 SOC-based systems. 67 66 Say Y if you want to use audio devices on MI2S. 68 67 69 68 config SND_SOC_QCOM_COMMON 69 + depends on SOUNDWIRE 70 70 tristate 71 71 72 72 config SND_SOC_QDSP6_COMMON ··· 144 142 depends on QCOM_APR 145 143 depends on COMMON_CLK 146 144 select SND_SOC_QDSP6 147 - select SND_SOC_QCOM_COMMON 145 + depends on SND_SOC_QCOM_COMMON 148 146 help 149 147 Support for Qualcomm Technologies LPASS audio block in 150 148 APQ8096 SoC-based systems. ··· 155 153 depends on QCOM_APR && I2C && SOUNDWIRE 156 154 depends on COMMON_CLK 157 155 select SND_SOC_QDSP6 158 - select SND_SOC_QCOM_COMMON 156 + depends on SND_SOC_QCOM_COMMON 159 157 select SND_SOC_RT5663 160 158 select SND_SOC_MAX98927 161 159 imply SND_SOC_CROS_EC_CODEC ··· 169 167 depends on QCOM_APR && SOUNDWIRE 170 168 depends on COMMON_CLK 171 169 select SND_SOC_QDSP6 172 - select SND_SOC_QCOM_COMMON 170 + depends on SND_SOC_QCOM_COMMON 173 171 help 174 172 To add support for audio on Qualcomm Technologies Inc. 175 173 SM8250 SoC-based systems. ··· 180 178 depends on QCOM_APR && SOUNDWIRE 181 179 depends on COMMON_CLK 182 180 select SND_SOC_QDSP6 183 - select SND_SOC_QCOM_COMMON 181 + depends on SND_SOC_QCOM_COMMON 184 182 help 185 183 To add support for audio on Qualcomm Technologies Inc. 186 184 SC8280XP SoC-based systems. ··· 190 188 tristate "SoC Machine driver for SC7180 boards" 191 189 depends on I2C && GPIOLIB 192 190 depends on SOUNDWIRE || SOUNDWIRE=n 193 - select SND_SOC_QCOM_COMMON 191 + depends on SND_SOC_QCOM_COMMON 194 192 select SND_SOC_LPASS_SC7180 195 193 select SND_SOC_MAX98357A 196 194 select SND_SOC_RT5682_I2C ··· 204 202 config SND_SOC_SC7280 205 203 tristate "SoC Machine driver for SC7280 boards" 206 204 depends on I2C && SOUNDWIRE 207 - select SND_SOC_QCOM_COMMON 205 + depends on SND_SOC_QCOM_COMMON 208 206 select SND_SOC_LPASS_SC7280 209 207 select SND_SOC_MAX98357A 210 208 select SND_SOC_WCD938X_SDW
-2
sound/soc/qcom/common.c
··· 180 180 } 181 181 EXPORT_SYMBOL_GPL(qcom_snd_parse_of); 182 182 183 - #if IS_ENABLED(CONFIG_SOUNDWIRE) 184 183 int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, 185 184 struct sdw_stream_runtime *sruntime, 186 185 bool *stream_prepared) ··· 293 294 return 0; 294 295 } 295 296 EXPORT_SYMBOL_GPL(qcom_snd_sdw_hw_free); 296 - #endif 297 297 298 298 int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, 299 299 struct snd_soc_jack *jack, bool *jack_setup)
-23
sound/soc/qcom/common.h
··· 11 11 int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, 12 12 struct snd_soc_jack *jack, bool *jack_setup); 13 13 14 - #if IS_ENABLED(CONFIG_SOUNDWIRE) 15 14 int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, 16 15 struct sdw_stream_runtime *runtime, 17 16 bool *stream_prepared); ··· 20 21 int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, 21 22 struct sdw_stream_runtime *sruntime, 22 23 bool *stream_prepared); 23 - #else 24 - static inline int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, 25 - struct sdw_stream_runtime *runtime, 26 - bool *stream_prepared) 27 - { 28 - return -ENOTSUPP; 29 - } 30 - 31 - static inline int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream, 32 - struct snd_pcm_hw_params *params, 33 - struct sdw_stream_runtime **psruntime) 34 - { 35 - return -ENOTSUPP; 36 - } 37 - 38 - static inline int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, 39 - struct sdw_stream_runtime *sruntime, 40 - bool *stream_prepared) 41 - { 42 - return -ENOTSUPP; 43 - } 44 - #endif 45 24 #endif