[alsa-devel] [PATCH] ASoC: atmel_pcm: use endian agnostic IO accessors

Ben Dooks ben.dooks at codethink.co.uk
Thu Mar 26 16:28:01 CET 2015


The atmel-pcm.h is using __raw_readl and __raw_writel for IO
accessors which do not work if the processor is in big endian
mode (the peripheral will still expect data in little endian
format).

Note, I do not think this is being used in the AVR32 which
would require a different fix (possible after atmel_io.h is
merged).

This has not been run-tested as I do not have a board with
an audio code on.

Signed-off-by: Ben Dooks <ben.dooks at codethink.co.uk>
--
CC: Bo Shen <voice.shen at atmel.com>
CC: Liam Girdwood <lgirdwood at gmail.com>
CC: Mark Brown <broonie at kernel.org>
CC: Jaroslav Kysela <perex at perex.cz>
CC: Takashi Iwai <tiwai at suse.de>
CC: alsa-devel at alsa-project.org
---
 sound/soc/atmel/atmel-pcm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/atmel/atmel-pcm.h b/sound/soc/atmel/atmel-pcm.h
index 12ae814..8f5f551 100644
--- a/sound/soc/atmel/atmel-pcm.h
+++ b/sound/soc/atmel/atmel-pcm.h
@@ -80,8 +80,8 @@ struct atmel_pcm_dma_params {
 /*
  * SSC register access (since ssc_writel() / ssc_readl() require literal name)
  */
-#define ssc_readx(base, reg)            (__raw_readl((base) + (reg)))
-#define ssc_writex(base, reg, value)    __raw_writel((value), (base) + (reg))
+#define ssc_readx(base, reg)            (readl_relaxed((base) + (reg)))
+#define ssc_writex(base, reg, value)    writel_relaxed((value), (base) + (reg))
 
 int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd);
 void atmel_pcm_free(struct snd_pcm *pcm);
-- 
2.1.4



More information about the Alsa-devel mailing list