diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2022-10-24 18:52:57 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-10-26 15:17:54 +0200 |
commit | 74fe0c4dcb41678543915cb97928c366ac1aaceb (patch) | |
tree | fb49aa0fc923ff0e157a01c14fa25a318e3e73ba /sound/soc/sof/ops.h | |
parent | ASoC: SOF: Intel: use mmio fallback for all platforms (diff) | |
download | linux-74fe0c4dcb41678543915cb97928c366ac1aaceb.tar.xz linux-74fe0c4dcb41678543915cb97928c366ac1aaceb.zip |
ASoC: SOF: ops: add readb/writeb helpers
These will be used to add more consistency in the SOF core and
drivers.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221024165310.246183-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ops.h')
-rw-r--r-- | sound/soc/sof/ops.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h index a72f8043be64..511c798eb1eb 100644 --- a/sound/soc/sof/ops.h +++ b/sound/soc/sof/ops.h @@ -302,6 +302,15 @@ 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, + u32 offset, u8 value) +{ + if (sof_ops(sdev)->writeb) + sof_ops(sdev)->writeb(sdev, sdev->bar[bar] + offset, value); + else + writeb(value, sdev->bar[bar] + offset); +} + static inline void snd_sof_dsp_write(struct snd_sof_dev *sdev, u32 bar, u32 offset, u32 value) { @@ -320,6 +329,15 @@ 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, + u32 offset) +{ + if (sof_ops(sdev)->readb) + return sof_ops(sdev)->readb(sdev, sdev->bar[bar] + offset); + else + return readb(sdev->bar[bar] + offset); +} + static inline u32 snd_sof_dsp_read(struct snd_sof_dev *sdev, u32 bar, u32 offset) { |