diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-11-10 09:54:43 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-10 16:15:14 -0500 |
commit | c56308775b5b81683789f9ee03f009493b51e6ab (patch) | |
tree | 34c730e059f37392e97ceb9be70707f60366b16d | |
parent | 7e6358ec3b6f69815a42af6203219584a80d4e22 (diff) |
ASoC: rt5514: work around link error
The main rt5514 driver optionally calls into the SPI back-end to load
the firmware. This causes a link error when one driver selects rt5514
as built-in and another driver selects rt5514-spi as a loadable module:
sound/soc/codecs/rt5514.o: In function `rt5514_dsp_voice_wake_up_put':
rt5514.c:(.text+0xac8): undefined reference to `rt5514_spi_burst_write'
As a workaround, this adds another silent symbol, to force rt5514-spi
to be built-in for that configuration. I'm not overly happy with
that solution, but couldn't come up with anything better. Using
'IS_REACHABLE()' would break the case that relies on the loadable
module, and all other ideas would result in more complexity.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/Kconfig | 4 | ||||
-rw-r--r-- | sound/soc/codecs/Makefile | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index c367d11079bc..01f436cc14c6 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig | |||
@@ -749,6 +749,10 @@ config SND_SOC_RT5514 | |||
749 | config SND_SOC_RT5514_SPI | 749 | config SND_SOC_RT5514_SPI |
750 | tristate | 750 | tristate |
751 | 751 | ||
752 | config SND_SOC_RT5514_SPI_BUILTIN | ||
753 | bool # force RT5514_SPI to be built-in to avoid link errors | ||
754 | default SND_SOC_RT5514=y && SND_SOC_RT5514_SPI=m | ||
755 | |||
752 | config SND_SOC_RT5616 | 756 | config SND_SOC_RT5616 |
753 | tristate "Realtek RT5616 CODEC" | 757 | tristate "Realtek RT5616 CODEC" |
754 | depends on I2C | 758 | depends on I2C |
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 77c18189c9ad..2dc42b296973 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile | |||
@@ -359,6 +359,7 @@ obj-$(CONFIG_SND_SOC_RT286) += snd-soc-rt286.o | |||
359 | obj-$(CONFIG_SND_SOC_RT298) += snd-soc-rt298.o | 359 | obj-$(CONFIG_SND_SOC_RT298) += snd-soc-rt298.o |
360 | obj-$(CONFIG_SND_SOC_RT5514) += snd-soc-rt5514.o | 360 | obj-$(CONFIG_SND_SOC_RT5514) += snd-soc-rt5514.o |
361 | obj-$(CONFIG_SND_SOC_RT5514_SPI) += snd-soc-rt5514-spi.o | 361 | obj-$(CONFIG_SND_SOC_RT5514_SPI) += snd-soc-rt5514-spi.o |
362 | obj-$(CONFIG_SND_SOC_RT5514_SPI_BUILTIN) += snd-soc-rt5514-spi.o | ||
362 | obj-$(CONFIG_SND_SOC_RT5616) += snd-soc-rt5616.o | 363 | obj-$(CONFIG_SND_SOC_RT5616) += snd-soc-rt5616.o |
363 | obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o | 364 | obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o |
364 | obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o | 365 | obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o |