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>
This commit is contained in:
Pierre-Louis Bossart 2022-10-31 15:53:40 -04:00 committed by Mark Brown
parent b3d2170916
commit f8fbf0dc70
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
5 changed files with 16 additions and 16 deletions

View File

@ -349,7 +349,7 @@ static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev)
{
int retry = HDA_DSP_REG_POLL_RETRY_COUNT;
while (snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, SOF_HDA_VS_D0I3C) & SOF_HDA_VS_D0I3C_CIP) {
while (snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, SOF_HDA_VS_D0I3C) & SOF_HDA_VS_D0I3C_CIP) {
if (!retry--)
return -ETIMEDOUT;
usleep_range(10, 15);
@ -389,7 +389,7 @@ static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)
}
/* Update D0I3C register */
snd_sof_dsp_updateb(sdev, HDA_DSP_HDA_BAR,
snd_sof_dsp_update8(sdev, HDA_DSP_HDA_BAR,
SOF_HDA_VS_D0I3C, SOF_HDA_VS_D0I3C_I3, value);
/* Wait for cmd in progress to be cleared before exiting the function */
@ -399,7 +399,7 @@ static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)
return ret;
}
reg = snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, SOF_HDA_VS_D0I3C);
reg = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, SOF_HDA_VS_D0I3C);
trace_sof_intel_D0I3C_updated(sdev, reg);
return 0;

View File

@ -455,7 +455,7 @@ int hda_dsp_iccmax_stream_hw_params(struct snd_sof_dev *sdev, struct hdac_ext_st
mask, mask);
/* Follow HW recommendation to set the guardband value to 95us during FW boot */
snd_sof_dsp_updateb(sdev, HDA_DSP_HDA_BAR, HDA_VS_INTEL_LTRP,
snd_sof_dsp_update8(sdev, HDA_DSP_HDA_BAR, HDA_VS_INTEL_LTRP,
HDA_VS_INTEL_LTRP_GB_MASK, HDA_LTRP_GB_VALUE_US);
/* start DMA */

View File

@ -630,7 +630,7 @@ void hda_ipc_irq_dump(struct snd_sof_dev *sdev)
intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS);
intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL);
ppsts = snd_sof_dsp_read(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPSTS);
rirbsts = snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, AZX_REG_RIRBSTS);
rirbsts = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, AZX_REG_RIRBSTS);
dev_err(sdev->dev, "hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n",
intsts, intctl, rirbsts);

View File

@ -302,11 +302,11 @@ static inline int snd_sof_debugfs_add_region_item(struct snd_sof_dev *sdev,
}
/* register IO */
static inline void snd_sof_dsp_writeb(struct snd_sof_dev *sdev, u32 bar,
static inline void snd_sof_dsp_write8(struct snd_sof_dev *sdev, u32 bar,
u32 offset, u8 value)
{
if (sof_ops(sdev)->writeb)
sof_ops(sdev)->writeb(sdev, sdev->bar[bar] + offset, value);
if (sof_ops(sdev)->write8)
sof_ops(sdev)->write8(sdev, sdev->bar[bar] + offset, value);
else
writeb(value, sdev->bar[bar] + offset);
}
@ -329,11 +329,11 @@ static inline void snd_sof_dsp_write64(struct snd_sof_dev *sdev, u32 bar,
writeq(value, sdev->bar[bar] + offset);
}
static inline u8 snd_sof_dsp_readb(struct snd_sof_dev *sdev, u32 bar,
static inline u8 snd_sof_dsp_read8(struct snd_sof_dev *sdev, u32 bar,
u32 offset)
{
if (sof_ops(sdev)->readb)
return sof_ops(sdev)->readb(sdev, sdev->bar[bar] + offset);
if (sof_ops(sdev)->read8)
return sof_ops(sdev)->read8(sdev, sdev->bar[bar] + offset);
else
return readb(sdev->bar[bar] + offset);
}
@ -356,15 +356,15 @@ static inline u64 snd_sof_dsp_read64(struct snd_sof_dev *sdev, u32 bar,
return readq(sdev->bar[bar] + offset);
}
static inline void snd_sof_dsp_updateb(struct snd_sof_dev *sdev, u32 bar,
static inline void snd_sof_dsp_update8(struct snd_sof_dev *sdev, u32 bar,
u32 offset, u8 value, u8 mask)
{
u8 reg;
reg = snd_sof_dsp_readb(sdev, bar, offset);
reg = snd_sof_dsp_read8(sdev, bar, offset);
reg &= ~mask;
reg |= value;
snd_sof_dsp_writeb(sdev, bar, offset, reg);
snd_sof_dsp_write8(sdev, bar, offset, reg);
}
/* block IO */

View File

@ -174,9 +174,9 @@ struct snd_sof_dsp_ops {
* TODO: consider removing these operations and calling respective
* implementations directly
*/
void (*writeb)(struct snd_sof_dev *sof_dev, void __iomem *addr,
void (*write8)(struct snd_sof_dev *sof_dev, void __iomem *addr,
u8 value); /* optional */
u8 (*readb)(struct snd_sof_dev *sof_dev,
u8 (*read8)(struct snd_sof_dev *sof_dev,
void __iomem *addr); /* optional */
void (*write)(struct snd_sof_dev *sof_dev, void __iomem *addr,
u32 value); /* optional */