Commit f8fbf0dc authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

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: default avatarNathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/alsa-devel/Y1rTFrohLqaiZAy%2F@dev-arch.thelio-3990X/Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221031195340.249868-1-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b3d21709
...@@ -349,7 +349,7 @@ static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev) ...@@ -349,7 +349,7 @@ static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev)
{ {
int retry = HDA_DSP_REG_POLL_RETRY_COUNT; 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--) if (!retry--)
return -ETIMEDOUT; return -ETIMEDOUT;
usleep_range(10, 15); usleep_range(10, 15);
...@@ -389,7 +389,7 @@ static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value) ...@@ -389,7 +389,7 @@ static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)
} }
/* Update D0I3C register */ /* 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); SOF_HDA_VS_D0I3C, SOF_HDA_VS_D0I3C_I3, value);
/* Wait for cmd in progress to be cleared before exiting the function */ /* 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) ...@@ -399,7 +399,7 @@ static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)
return ret; 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); trace_sof_intel_D0I3C_updated(sdev, reg);
return 0; return 0;
......
...@@ -455,7 +455,7 @@ int hda_dsp_iccmax_stream_hw_params(struct snd_sof_dev *sdev, struct hdac_ext_st ...@@ -455,7 +455,7 @@ int hda_dsp_iccmax_stream_hw_params(struct snd_sof_dev *sdev, struct hdac_ext_st
mask, mask); mask, mask);
/* Follow HW recommendation to set the guardband value to 95us during FW boot */ /* 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); HDA_VS_INTEL_LTRP_GB_MASK, HDA_LTRP_GB_VALUE_US);
/* start DMA */ /* start DMA */
......
...@@ -630,7 +630,7 @@ void hda_ipc_irq_dump(struct snd_sof_dev *sdev) ...@@ -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); 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); 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); 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", dev_err(sdev->dev, "hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n",
intsts, intctl, rirbsts); intsts, intctl, rirbsts);
......
...@@ -302,11 +302,11 @@ static inline int snd_sof_debugfs_add_region_item(struct snd_sof_dev *sdev, ...@@ -302,11 +302,11 @@ static inline int snd_sof_debugfs_add_region_item(struct snd_sof_dev *sdev,
} }
/* register IO */ /* 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) u32 offset, u8 value)
{ {
if (sof_ops(sdev)->writeb) if (sof_ops(sdev)->write8)
sof_ops(sdev)->writeb(sdev, sdev->bar[bar] + offset, value); sof_ops(sdev)->write8(sdev, sdev->bar[bar] + offset, value);
else else
writeb(value, sdev->bar[bar] + offset); writeb(value, sdev->bar[bar] + offset);
} }
...@@ -329,11 +329,11 @@ static inline void snd_sof_dsp_write64(struct snd_sof_dev *sdev, u32 bar, ...@@ -329,11 +329,11 @@ static inline void snd_sof_dsp_write64(struct snd_sof_dev *sdev, u32 bar,
writeq(value, sdev->bar[bar] + offset); 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) u32 offset)
{ {
if (sof_ops(sdev)->readb) if (sof_ops(sdev)->read8)
return sof_ops(sdev)->readb(sdev, sdev->bar[bar] + offset); return sof_ops(sdev)->read8(sdev, sdev->bar[bar] + offset);
else else
return readb(sdev->bar[bar] + offset); return readb(sdev->bar[bar] + offset);
} }
...@@ -356,15 +356,15 @@ static inline u64 snd_sof_dsp_read64(struct snd_sof_dev *sdev, u32 bar, ...@@ -356,15 +356,15 @@ static inline u64 snd_sof_dsp_read64(struct snd_sof_dev *sdev, u32 bar,
return readq(sdev->bar[bar] + offset); 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) u32 offset, u8 value, u8 mask)
{ {
u8 reg; u8 reg;
reg = snd_sof_dsp_readb(sdev, bar, offset); reg = snd_sof_dsp_read8(sdev, bar, offset);
reg &= ~mask; reg &= ~mask;
reg |= value; reg |= value;
snd_sof_dsp_writeb(sdev, bar, offset, reg); snd_sof_dsp_write8(sdev, bar, offset, reg);
} }
/* block IO */ /* block IO */
......
...@@ -174,9 +174,9 @@ struct snd_sof_dsp_ops { ...@@ -174,9 +174,9 @@ struct snd_sof_dsp_ops {
* TODO: consider removing these operations and calling respective * TODO: consider removing these operations and calling respective
* implementations directly * 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 value); /* optional */
u8 (*readb)(struct snd_sof_dev *sof_dev, u8 (*read8)(struct snd_sof_dev *sof_dev,
void __iomem *addr); /* optional */ void __iomem *addr); /* optional */
void (*write)(struct snd_sof_dev *sof_dev, void __iomem *addr, void (*write)(struct snd_sof_dev *sof_dev, void __iomem *addr,
u32 value); /* optional */ u32 value); /* optional */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment