]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: SOF: fix compilation issue with readb/writeb helpers
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 31 Oct 2022 19:53:40 +0000 (15:53 -0400)
committerMark Brown <broonie@kernel.org>
Mon, 31 Oct 2022 21:15:19 +0000 (21:15 +0000)
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>
sound/soc/sof/intel/hda-dsp.c
sound/soc/sof/intel/hda-stream.c
sound/soc/sof/intel/hda.c
sound/soc/sof/ops.h
sound/soc/sof/sof-priv.h

index c61bab1a5719607fbf806825a726e61e51355bd7..6d5c26a2147ecaa25f6a4d21c01b0d273c14e538 100644 (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;
index 8e3f058576326ae78c51d8dbb706106f77c49aa0..7f0fd05a96e6b165d23bd47d226b936574ae952a 100644 (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 */
index 99be5ef7832403f5a53b720998f146fbdcb6cfa2..348fbfb6a2c2d58b5d0cb32a6f2694dd81071f88 100644 (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);
index 8cb93e7c0c6702eaf94ec8509977eb7ee0a3ea1d..c527522505650e5b548741d9cb1777634e830d19 100644 (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 */
index eb1192dbdfb61ca308ac76511721a79f9cc68b4a..6760fd8959509391ba70d516c641edf522f9660b 100644 (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 */