Commit 4c121129 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown

ASoC: rt5677: fix SPI dependency

The rt5677 codec has gained code that requires SPI to work correctly,
but there is no provision in Kconfig to prevent the driver from
being used when SPI is disabled or a loadable module, resulting
in this build error:

sound/built-in.o: In function `rt5677_spi_write':
:(.text+0xa7ba0): undefined reference to `spi_sync'
sound/built-in.o: In function `rt5677_spi_driver_init':
:(.init.text+0x253c): undefined reference to `spi_register_driver'

ERROR: "spi_sync" [sound/soc/codecs/snd-soc-rt5677-spi.ko] undefined!
ERROR: "spi_register_driver" [sound/soc/codecs/snd-soc-rt5677-spi.ko] undefined!

This makes the SPI portion of the driver depend on the SPI subsystem,
and disables the function that uses SPI for firmware download if SPI
is disabled. The latter may not be the correct solution, but I could
not come up with a better one.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: af48f1d0 ("ASoC: rt5677: Support DSP function for VAD application")
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9913b9f5
...@@ -525,7 +525,7 @@ config SND_SOC_RT5677 ...@@ -525,7 +525,7 @@ config SND_SOC_RT5677
config SND_SOC_RT5677_SPI config SND_SOC_RT5677_SPI
tristate tristate
default SND_SOC_RT5677 default SND_SOC_RT5677 && SPI
#Freescale sgtl5000 codec #Freescale sgtl5000 codec
config SND_SOC_SGTL5000 config SND_SOC_SGTL5000
......
...@@ -702,6 +702,9 @@ static int rt5677_set_dsp_vad(struct snd_soc_codec *codec, bool on) ...@@ -702,6 +702,9 @@ static int rt5677_set_dsp_vad(struct snd_soc_codec *codec, bool on)
static bool activity; static bool activity;
int ret; int ret;
if (!IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI))
return -ENXIO;
if (on && !activity) { if (on && !activity) {
activity = true; activity = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment