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

ASoC: SOF: mediatek: Fix allyesconfig build error

ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o:(.opd+0x18): multiple
definition of `adsp_clock_on';
sound/soc/sof/mediatek/mt8195/mt8195-clk.o:(.opd+0x60): first defined
here
ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o: in function
`.adsp_clock_on':

ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o:(.opd+0x30): multiple
definition of `adsp_clock_off';
sound/soc/sof/mediatek/mt8195/mt8195-clk.o:(.opd+0x78): first defined
here
ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o: in function
`.adsp_clock_off':

ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o:(.opd+0x0): multiple
definition of `sof_hifixdsp_boot_sequence';
sound/soc/sof/mediatek/mt8195/mt8195-loader.o:(.opd+0x0): first defined
here
ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o: in function
`.sof_hifixdsp_boot_sequence':

ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o:(.opd+0x18): multiple
definition of `sof_hifixdsp_shutdown';
sound/soc/sof/mediatek/mt8195/mt8195-loader.o:(.opd+0x18): first defined
here
ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o: in function
`.sof_hifixdsp_shutdown':

Fixes: 570c14dc92d5 ("ASoC: SOF: mediatek: Add mt8186 sof fw loader and
dsp ops")
Fixes: 210b3ab932f7 ("ASoC: SOF: mediatek: Add mt8186 dsp clock support")

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Link: https://lore.kernel.org/r/20220427071030.10172-1-tinghan.shen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Tinghan Shen and committed by
Mark Brown
9ce170dc 79fc62d6

+17 -17
+2 -2
sound/soc/sof/mediatek/mt8186/mt8186-clk.c
··· 74 74 clk_disable_unprepare(priv->clk[CLK_TOP_AUDIODSP]); 75 75 } 76 76 77 - int adsp_clock_on(struct snd_sof_dev *sdev) 77 + int mt8186_adsp_clock_on(struct snd_sof_dev *sdev) 78 78 { 79 79 struct device *dev = sdev->dev; 80 80 int ret; ··· 92 92 return 0; 93 93 } 94 94 95 - void adsp_clock_off(struct snd_sof_dev *sdev) 95 + void mt8186_adsp_clock_off(struct snd_sof_dev *sdev) 96 96 { 97 97 snd_sof_dsp_write(sdev, DSP_REG_BAR, ADSP_CK_EN, 0); 98 98 snd_sof_dsp_write(sdev, DSP_REG_BAR, ADSP_UART_CTRL, 0);
+2 -2
sound/soc/sof/mediatek/mt8186/mt8186-clk.h
··· 19 19 }; 20 20 21 21 int mt8186_adsp_init_clock(struct snd_sof_dev *sdev); 22 - int adsp_clock_on(struct snd_sof_dev *sdev); 23 - void adsp_clock_off(struct snd_sof_dev *sdev); 22 + int mt8186_adsp_clock_on(struct snd_sof_dev *sdev); 23 + void mt8186_adsp_clock_off(struct snd_sof_dev *sdev); 24 24 #endif
+2 -2
sound/soc/sof/mediatek/mt8186/mt8186-loader.c
··· 11 11 #include "mt8186.h" 12 12 #include "../../ops.h" 13 13 14 - void sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr) 14 + void mt8186_sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr) 15 15 { 16 16 /* set RUNSTALL to stop core */ 17 17 snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, ADSP_HIFI_IO_CONFIG, ··· 39 39 RUNSTALL, 0); 40 40 } 41 41 42 - void sof_hifixdsp_shutdown(struct snd_sof_dev *sdev) 42 + void mt8186_sof_hifixdsp_shutdown(struct snd_sof_dev *sdev) 43 43 { 44 44 /* set RUNSTALL to stop core */ 45 45 snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, ADSP_HIFI_IO_CONFIG,
+9 -9
sound/soc/sof/mediatek/mt8186/mt8186.c
··· 211 211 212 212 adsp_bootup_addr = SRAM_PHYS_BASE_FROM_DSP_VIEW; 213 213 dev_dbg(sdev->dev, "HIFIxDSP boot from base : 0x%08X\n", adsp_bootup_addr); 214 - sof_hifixdsp_boot_sequence(sdev, adsp_bootup_addr); 214 + mt8186_sof_hifixdsp_boot_sequence(sdev, adsp_bootup_addr); 215 215 216 216 return 0; 217 217 } ··· 284 284 return ret; 285 285 } 286 286 287 - ret = adsp_clock_on(sdev); 287 + ret = mt8186_adsp_clock_on(sdev); 288 288 if (ret) { 289 - dev_err(sdev->dev, "adsp_clock_on fail!\n"); 289 + dev_err(sdev->dev, "mt8186_adsp_clock_on fail!\n"); 290 290 return ret; 291 291 } 292 292 ··· 297 297 298 298 static int mt8186_dsp_remove(struct snd_sof_dev *sdev) 299 299 { 300 - sof_hifixdsp_shutdown(sdev); 300 + mt8186_sof_hifixdsp_shutdown(sdev); 301 301 adsp_sram_power_off(sdev); 302 - adsp_clock_off(sdev); 302 + mt8186_adsp_clock_off(sdev); 303 303 304 304 return 0; 305 305 } 306 306 307 307 static int mt8186_dsp_suspend(struct snd_sof_dev *sdev, u32 target_state) 308 308 { 309 - sof_hifixdsp_shutdown(sdev); 309 + mt8186_sof_hifixdsp_shutdown(sdev); 310 310 adsp_sram_power_off(sdev); 311 - adsp_clock_off(sdev); 311 + mt8186_adsp_clock_off(sdev); 312 312 313 313 return 0; 314 314 } ··· 317 317 { 318 318 int ret; 319 319 320 - ret = adsp_clock_on(sdev); 320 + ret = mt8186_adsp_clock_on(sdev); 321 321 if (ret) { 322 - dev_err(sdev->dev, "adsp_clock_on fail!\n"); 322 + dev_err(sdev->dev, "mt8186_adsp_clock_on fail!\n"); 323 323 return ret; 324 324 } 325 325
+2 -2
sound/soc/sof/mediatek/mt8186/mt8186.h
··· 75 75 #define SIZE_SHARED_DRAM_UL 0x40000 /*Shared buffer for Uplink*/ 76 76 #define TOTAL_SIZE_SHARED_DRAM_FROM_TAIL (SIZE_SHARED_DRAM_DL + SIZE_SHARED_DRAM_UL) 77 77 78 - void sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr); 79 - void sof_hifixdsp_shutdown(struct snd_sof_dev *sdev); 78 + void mt8186_sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr); 79 + void mt8186_sof_hifixdsp_shutdown(struct snd_sof_dev *sdev); 80 80 #endif