[alsa-devel] [PATCH 2/4] ASoC: Do not swap upper and lower byte in snd_soc_4_12_spi_write

Lars-Peter Clausen lars at metafoo.de
Thu May 5 19:52:44 CEST 2011

snd_soc_4_12_spi_write swaps the upper and the lower byte of the to be
transferred data. The function was added for the ad1836, which was used in
16bit mode on the blackfin boards. In this mode the blackfin SPI core swaps the
upper and the lower byte before putting them on the wire (i.e interprets the
word as litte-endian), so the data had to be passed in reversed, so it would
appear in correct order on the wire.
Since this behaviour not necessarily applicable to other configurations
remove the special case.

The blackfin boards using the ad1836 were changed to used 8-bit mode in the
previous commit.

Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>
 sound/soc/soc-cache.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index a217db2..080fab2 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -115,8 +115,8 @@ static int snd_soc_4_12_spi_write(void *control_data, const char *data,
 	u8 msg[2];
-	msg[0] = data[1];
-	msg[1] = data[0];
+	msg[0] = data[0];
+	msg[1] = data[1];
 	return do_spi_write(control_data, msg, len);

More information about the Alsa-devel mailing list