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

ASoC: Intel: sst: only use sst-firmware when DW DMAC is available

Currentlly, we use Synopsys DesignWare DMA Controller for
baytrail/haswell/broadwell ADSP firmware loading, but for
skylake, we don't use it, compiling sst-firmware.c may
introduce error when CONFIG_DW_DMAC_CORE is not enabled:

sound/built-in.o: In function `sst_dma_new':
(.text+0xd7b38): undefined reference to `dw_dma_probe'
sound/built-in.o: In function `sst_dma_free':
(.text+0xd7c0a): undefined reference to `dw_dma_remove'

Here we only compile sst-firmware when CONFIG_DW_DMAC_CORE
is selected, to fix the linking error issue.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jie Yang and committed by
Mark Brown
ef3e199a 624729fd

+9 -1
+5 -1
sound/soc/intel/common/Makefile
··· 1 - snd-soc-sst-dsp-objs := sst-dsp.o sst-firmware.o 1 + snd-soc-sst-dsp-objs := sst-dsp.o 2 2 snd-soc-sst-acpi-objs := sst-acpi.o 3 3 snd-soc-sst-ipc-objs := sst-ipc.o 4 + 5 + ifneq ($(CONFIG_DW_DMAC_CORE),) 6 + snd-soc-sst-dsp-objs += sst-firmware.o 7 + endif 4 8 5 9 obj-$(CONFIG_SND_SOC_INTEL_SST) += snd-soc-sst-dsp.o snd-soc-sst-ipc.o 6 10 obj-$(CONFIG_SND_SOC_INTEL_SST_ACPI) += snd-soc-sst-acpi.o
+2
sound/soc/intel/common/sst-dsp.c
··· 420 420 } 421 421 EXPORT_SYMBOL_GPL(sst_dsp_inbox_read); 422 422 423 + #if IS_ENABLED(CONFIG_DW_DMAC_CORE) 423 424 struct sst_dsp *sst_dsp_new(struct device *dev, 424 425 struct sst_dsp_device *sst_dev, struct sst_pdata *pdata) 425 426 { ··· 485 484 sst_dma_free(sst->dma); 486 485 } 487 486 EXPORT_SYMBOL_GPL(sst_dsp_free); 487 + #endif 488 488 489 489 /* Module information */ 490 490 MODULE_AUTHOR("Liam Girdwood");
+2
sound/soc/intel/common/sst-dsp.h
··· 216 216 void *dsp; 217 217 }; 218 218 219 + #if IS_ENABLED(CONFIG_DW_DMAC_CORE) 219 220 /* Initialization */ 220 221 struct sst_dsp *sst_dsp_new(struct device *dev, 221 222 struct sst_dsp_device *sst_dev, struct sst_pdata *pdata); 222 223 void sst_dsp_free(struct sst_dsp *sst); 224 + #endif 223 225 224 226 /* SHIM Read / Write */ 225 227 void sst_dsp_shim_write(struct sst_dsp *sst, u32 offset, u32 value);