alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Mike Frysinger <vapier@gentoo.org>
Cc: device-driver-devel@blackfin.uclinux.org,
	uclinux-dist-devel@blackfin.uclinux.org,
	alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 2/4] ASoC: Do not swap upper and lower byte in snd_soc_4_12_spi_write
Date: Thu,  5 May 2011 19:52:44 +0200	[thread overview]
Message-ID: <1304617966-4410-2-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1304617966-4410-1-git-send-email-lars@metafoo.de>

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@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);
 }
-- 
1.7.2.5

  reply	other threads:[~2011-05-05 17:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05 17:52 [PATCH 1/4] Blackfin: Use 8bit spi transfers for the ad1836 Lars-Peter Clausen
2011-05-05 17:52 ` Lars-Peter Clausen [this message]
2011-05-05 17:52 ` [PATCH 3/4] ASoC: Get rid of snd_soc_*_*_spi_write wrapper functions Lars-Peter Clausen
2011-05-12 12:25   ` Barry Song
2011-05-05 17:52 ` [PATCH 4/4] ASoC: Use spi_write in do_spi_write Lars-Peter Clausen
2011-05-05 22:56 ` [uclinux-dist-devel] [PATCH 1/4] Blackfin: Use 8bit spi transfers for the ad1836 Mike Frysinger
2011-05-06 12:28   ` Lars-Peter Clausen
2011-05-06 12:48     ` Mark Brown
2011-05-06 13:12       ` [Device-drivers-devel] " Mike Frysinger
2011-05-06 13:19       ` Lars-Peter Clausen
2011-05-06 13:26         ` Mark Brown
2011-05-06 13:31           ` Lars-Peter Clausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304617966-4410-2-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=device-driver-devel@blackfin.uclinux.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).