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

ASoC: SOF: fix compilation issue with readb/writeb helpers

Replace them with read8/write8 to avoid compilation issue on ARM. In
hindsight this is more consistent with the read64/write64 helpers
already used in SOF.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/alsa-devel/Y1rTFrohLqaiZAy%2F@dev-arch.thelio-3990X/
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221031195340.249868-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Pierre-Louis Bossart and committed by
Mark Brown
f8fbf0dc b3d21709

+16 -16
+3 -3
sound/soc/sof/intel/hda-dsp.c
··· 349 349 { 350 350 int retry = HDA_DSP_REG_POLL_RETRY_COUNT; 351 351 352 - while (snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, SOF_HDA_VS_D0I3C) & SOF_HDA_VS_D0I3C_CIP) { 352 + while (snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, SOF_HDA_VS_D0I3C) & SOF_HDA_VS_D0I3C_CIP) { 353 353 if (!retry--) 354 354 return -ETIMEDOUT; 355 355 usleep_range(10, 15); ··· 389 389 } 390 390 391 391 /* Update D0I3C register */ 392 - snd_sof_dsp_updateb(sdev, HDA_DSP_HDA_BAR, 392 + snd_sof_dsp_update8(sdev, HDA_DSP_HDA_BAR, 393 393 SOF_HDA_VS_D0I3C, SOF_HDA_VS_D0I3C_I3, value); 394 394 395 395 /* Wait for cmd in progress to be cleared before exiting the function */ ··· 399 399 return ret; 400 400 } 401 401 402 - reg = snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, SOF_HDA_VS_D0I3C); 402 + reg = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, SOF_HDA_VS_D0I3C); 403 403 trace_sof_intel_D0I3C_updated(sdev, reg); 404 404 405 405 return 0;
+1 -1
sound/soc/sof/intel/hda-stream.c
··· 455 455 mask, mask); 456 456 457 457 /* Follow HW recommendation to set the guardband value to 95us during FW boot */ 458 - snd_sof_dsp_updateb(sdev, HDA_DSP_HDA_BAR, HDA_VS_INTEL_LTRP, 458 + snd_sof_dsp_update8(sdev, HDA_DSP_HDA_BAR, HDA_VS_INTEL_LTRP, 459 459 HDA_VS_INTEL_LTRP_GB_MASK, HDA_LTRP_GB_VALUE_US); 460 460 461 461 /* start DMA */
+1 -1
sound/soc/sof/intel/hda.c
··· 630 630 intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS); 631 631 intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL); 632 632 ppsts = snd_sof_dsp_read(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPSTS); 633 - rirbsts = snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, AZX_REG_RIRBSTS); 633 + rirbsts = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, AZX_REG_RIRBSTS); 634 634 635 635 dev_err(sdev->dev, "hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n", 636 636 intsts, intctl, rirbsts);
+9 -9
sound/soc/sof/ops.h
··· 302 302 } 303 303 304 304 /* register IO */ 305 - static inline void snd_sof_dsp_writeb(struct snd_sof_dev *sdev, u32 bar, 305 + static inline void snd_sof_dsp_write8(struct snd_sof_dev *sdev, u32 bar, 306 306 u32 offset, u8 value) 307 307 { 308 - if (sof_ops(sdev)->writeb) 309 - sof_ops(sdev)->writeb(sdev, sdev->bar[bar] + offset, value); 308 + if (sof_ops(sdev)->write8) 309 + sof_ops(sdev)->write8(sdev, sdev->bar[bar] + offset, value); 310 310 else 311 311 writeb(value, sdev->bar[bar] + offset); 312 312 } ··· 329 329 writeq(value, sdev->bar[bar] + offset); 330 330 } 331 331 332 - static inline u8 snd_sof_dsp_readb(struct snd_sof_dev *sdev, u32 bar, 332 + static inline u8 snd_sof_dsp_read8(struct snd_sof_dev *sdev, u32 bar, 333 333 u32 offset) 334 334 { 335 - if (sof_ops(sdev)->readb) 336 - return sof_ops(sdev)->readb(sdev, sdev->bar[bar] + offset); 335 + if (sof_ops(sdev)->read8) 336 + return sof_ops(sdev)->read8(sdev, sdev->bar[bar] + offset); 337 337 else 338 338 return readb(sdev->bar[bar] + offset); 339 339 } ··· 356 356 return readq(sdev->bar[bar] + offset); 357 357 } 358 358 359 - static inline void snd_sof_dsp_updateb(struct snd_sof_dev *sdev, u32 bar, 359 + static inline void snd_sof_dsp_update8(struct snd_sof_dev *sdev, u32 bar, 360 360 u32 offset, u8 value, u8 mask) 361 361 { 362 362 u8 reg; 363 363 364 - reg = snd_sof_dsp_readb(sdev, bar, offset); 364 + reg = snd_sof_dsp_read8(sdev, bar, offset); 365 365 reg &= ~mask; 366 366 reg |= value; 367 - snd_sof_dsp_writeb(sdev, bar, offset, reg); 367 + snd_sof_dsp_write8(sdev, bar, offset, reg); 368 368 } 369 369 370 370 /* block IO */
+2 -2
sound/soc/sof/sof-priv.h
··· 174 174 * TODO: consider removing these operations and calling respective 175 175 * implementations directly 176 176 */ 177 - void (*writeb)(struct snd_sof_dev *sof_dev, void __iomem *addr, 177 + void (*write8)(struct snd_sof_dev *sof_dev, void __iomem *addr, 178 178 u8 value); /* optional */ 179 - u8 (*readb)(struct snd_sof_dev *sof_dev, 179 + u8 (*read8)(struct snd_sof_dev *sof_dev, 180 180 void __iomem *addr); /* optional */ 181 181 void (*write)(struct snd_sof_dev *sof_dev, void __iomem *addr, 182 182 u32 value); /* optional */