From: Takashi Iwai <tiwai@suse.de>
To: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@slimlogic.co.uk>,
Barry Song <Barry.Song@analog.com>
Subject: Re: ASoC updates for 2.6.37
Date: Wed, 06 Oct 2010 16:24:18 +0200 [thread overview]
Message-ID: <s5h8w2bl7ql.wl%tiwai@suse.de> (raw)
In-Reply-To: <1286374422.9697.28.camel@dplaptop>
At Wed, 06 Oct 2010 15:13:42 +0100,
Dimitris Papastamos wrote:
>
> On Wed, 2010-10-06 at 15:46 +0200, Takashi Iwai wrote:
> > At Wed, 06 Oct 2010 14:40:04 +0100,
> > Dimitris Papastamos wrote:
> > >
> > > On Wed, 2010-10-06 at 15:30 +0200, Takashi Iwai wrote:
> > > > At Wed, 06 Oct 2010 10:25:40 +0100,
> > > > Dimitris Papastamos wrote:
> > > > >
> > > > > On Wed, 2010-10-06 at 08:31 +0100, Mark Brown wrote:
> > > > > On Wed, Oct 06, 2010 at 09:10:23AM +0200, Takashi Iwai wrote:
> > > > > >
> > > > > > > If the above difference is intentional, it should be commented
> > > > > > > somewhere.
> > > > > >
> > > > > > Meh, yes. Dimitris, please fix or add a comment as appropriate.
> > > > > >
> > > > >
> > > > > In snd_soc_7_9_spi_write we prepare the tx buffer to be register
> > > > > followed by data packed into 16 bits. In snd_soc_4_12_spi_write the tx
> > > > > buffer is swapped. I'd expect this to be consistent between the two
> > > > > transfers.
> > > >
> > > > Sorry, I don't understand your statement clearly.
> > > > So, the byte-swap behavior in snd_soc_4_12_spi_write() is designed?
> > >
> > > I meant to say that snd_soc_4_12_spi_write looks suspicious and that I'd
> > > expect it to behave similarly to snd_soc_7_9_spi_write. I don't see why
> > > the byte swapping is needed.
> >
> > OK, thanks for clarifying :)
> >
> > Looking through git commits, this was introduced by a patch from Barry
> > Song. Barry, could you check whether the current code is correct?
> >
> > I guess this is because the original code accessed unsigned short
> > while the new code is converted to a byte array. Maybe due to the
> > endianess, but it looks wrong.
>
> Looking at the commit now, I think his changes are consistent. Consider
> an example with reg = 0xf and value = 0xa, then his original unsigned
> short buf is equal to 0xf00a. If you follow the logic in
> snd_soc_4_12_write you will find that data[0] and data[1] are 0xf0 and
> 0x0a respectively. However on a say LE machine, his original buf is
> laid out in mem as 0af0 whereas the data buffer is laid out as f00a so
> he has to reverse that by swapping it in snd_soc_4_12_spi_write.
Yeah, I don't say it's buggy. But it's wrong from a programming POV.
The proper endianess handling seems missing in the current code...
Takashi
next prev parent reply other threads:[~2010-10-06 14:24 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 19:14 ASoC updates for 2.6.37 Mark Brown
2010-10-06 6:24 ` Takashi Iwai
2010-10-06 6:34 ` Mark Brown
2010-10-06 7:10 ` Takashi Iwai
2010-10-06 7:31 ` Mark Brown
2010-10-06 7:35 ` Takashi Iwai
2010-10-06 9:25 ` Dimitris Papastamos
2010-10-06 13:30 ` Takashi Iwai
2010-10-06 13:40 ` Dimitris Papastamos
2010-10-06 13:46 ` Takashi Iwai
2010-10-06 14:13 ` Dimitris Papastamos
2010-10-06 14:24 ` Takashi Iwai [this message]
2010-10-06 14:29 ` Dimitris Papastamos
2010-10-06 15:19 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2010-12-30 12:54 Mark Brown
2011-01-02 10:05 ` Takashi Iwai
2010-12-09 16:16 Mark Brown
2010-12-09 17:21 ` Takashi Iwai
2010-12-08 15:08 Mark Brown
2010-12-08 15:15 ` Takashi Iwai
2010-12-06 14:18 Mark Brown
2010-12-06 14:31 ` Takashi Iwai
2010-12-06 14:33 ` Mark Brown
2010-12-06 14:35 ` Takashi Iwai
2010-12-02 13:28 Mark Brown
2010-12-02 16:17 ` Takashi Iwai
2010-12-02 16:18 ` Mark Brown
2010-12-02 16:20 ` Takashi Iwai
2010-12-02 16:29 ` Liam Girdwood
2010-12-02 16:36 ` Takashi Iwai
2010-11-29 18:57 Mark Brown
2010-11-30 7:20 ` Takashi Iwai
2010-11-26 13:13 Mark Brown
2010-11-26 14:37 ` Takashi Iwai
2010-11-24 13:07 Mark Brown
2010-11-24 13:40 ` Takashi Iwai
2010-11-22 11:06 Mark Brown
2010-11-22 12:16 ` Takashi Iwai
2010-11-02 14:50 Mark Brown
2010-11-01 19:50 Mark Brown
2010-11-02 7:06 ` Takashi Iwai
2010-10-22 17:32 Mark Brown
2010-10-22 18:05 ` Takashi Iwai
2010-10-22 18:43 ` Mark Brown
2010-10-23 9:23 ` Takashi Iwai
2010-10-21 20:45 Mark Brown
2010-10-21 21:16 ` Takashi Iwai
2010-10-15 12:29 Mark Brown
2010-10-17 8:13 ` Takashi Iwai
2010-10-13 17:53 Mark Brown
2010-10-14 8:10 ` Takashi Iwai
2010-10-11 12:11 Mark Brown
2010-10-11 12:17 ` Takashi Iwai
2010-10-11 12:32 ` Mark Brown
2010-10-11 12:35 ` Takashi Iwai
2010-10-07 21:17 Mark Brown
2010-10-11 11:59 ` Takashi Iwai
2010-10-04 18:22 Mark Brown
2010-10-05 5:53 ` Takashi Iwai
2010-09-30 20:49 Mark Brown
2010-09-30 21:04 ` Takashi Iwai
2010-09-30 0:30 Mark Brown
2010-09-30 5:40 ` Takashi Iwai
2010-09-27 0:24 Mark Brown
2010-09-27 6:20 ` Takashi Iwai
2010-09-27 8:21 ` Dimitris Papastamos
2010-09-27 8:30 ` Takashi Iwai
2010-09-27 8:58 ` Dimitris Papastamos
2010-09-27 16:03 ` Mark Brown
2010-09-22 11:52 Mark Brown
2010-09-22 14:24 ` Takashi Iwai
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=s5h8w2bl7ql.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=Barry.Song@analog.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dp@opensource.wolfsonmicro.com \
--cc=lrg@slimlogic.co.uk \
/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).