Skip to content

Commit 69c5960

Browse files
committed
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>
1 parent 30db6e2 commit 69c5960

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎sound/soc/sof/intel/hda-dsp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev)
352352
const struct sof_intel_dsp_desc *chip;
353353

354354
chip = get_chip_info(pdata);
355-
while (snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, chip->d0i3_offset) &
355+
while (snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, chip->d0i3_offset) &
356356
SOF_HDA_VS_D0I3C_CIP) {
357357
if (!retry--)
358358
return -ETIMEDOUT;
@@ -406,7 +406,7 @@ static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)
406406
return ret;
407407
}
408408

409-
reg = snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, chip->d0i3_offset);
409+
reg = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, chip->d0i3_offset);
410410
trace_sof_intel_D0I3C_updated(sdev, reg);
411411

412412
return 0;

‎sound/soc/sof/intel/hda-loader.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ int hda_dsp_cl_boot_firmware_iccmax(struct snd_sof_dev *sdev)
326326
u8 original_gb;
327327

328328
/* save the original LTRP guardband value */
329-
original_gb = snd_sof_dsp_readb(sdev, HDA_DSP_HDA_BAR, HDA_VS_INTEL_LTRP) &
329+
original_gb = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, HDA_VS_INTEL_LTRP) &
330330
HDA_VS_INTEL_LTRP_GB_MASK;
331331

332332
/*

‎sound/soc/sof/intel/hda.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ void hda_ipc_irq_dump(struct snd_sof_dev *sdev)
630630
intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS);
631631
intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL);
632632
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);
634634

635635
dev_err(sdev->dev, "hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n",
636636
intsts, intctl, rirbsts);

‎sound/soc/sof/ops.h‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ static inline int snd_sof_debugfs_add_region_item(struct snd_sof_dev *sdev,
302302
}
303303

304304
/* 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,
306306
u32 offset, u8 value)
307307
{
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);
310310
else
311311
writeb(value, sdev->bar[bar] + offset);
312312
}
@@ -329,11 +329,11 @@ static inline void snd_sof_dsp_write64(struct snd_sof_dev *sdev, u32 bar,
329329
writeq(value, sdev->bar[bar] + offset);
330330
}
331331

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,
333333
u32 offset)
334334
{
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);
337337
else
338338
return readb(sdev->bar[bar] + offset);
339339
}
@@ -361,10 +361,10 @@ static inline void snd_sof_dsp_updateb(struct snd_sof_dev *sdev, u32 bar,
361361
{
362362
u8 reg;
363363

364-
reg = snd_sof_dsp_readb(sdev, bar, offset);
364+
reg = snd_sof_dsp_read8(sdev, bar, offset);
365365
reg &= ~mask;
366366
reg |= value;
367-
snd_sof_dsp_writeb(sdev, bar, offset, reg);
367+
snd_sof_dsp_write8(sdev, bar, offset, reg);
368368
}
369369

370370
/* block IO */

‎sound/soc/sof/sof-priv.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ struct snd_sof_dsp_ops {
174174
* TODO: consider removing these operations and calling respective
175175
* implementations directly
176176
*/
177-
void (*writeb)(struct snd_sof_dev *sof_dev, void __iomem *addr,
177+
void (*write8)(struct snd_sof_dev *sof_dev, void __iomem *addr,
178178
u8 value); /* optional */
179-
u8 (*readb)(struct snd_sof_dev *sof_dev,
179+
u8 (*read8)(struct snd_sof_dev *sof_dev,
180180
void __iomem *addr); /* optional */
181181
void (*write)(struct snd_sof_dev *sof_dev, void __iomem *addr,
182182
u32 value); /* optional */

0 commit comments

Comments
 (0)