From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
Mike Frysinger <vapier.adi@gmail.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH 1/2] ASoC: Remove byte swap in 4x12 SPI write
Date: Wed, 11 May 2011 11:02:26 -0700 [thread overview]
Message-ID: <4DCACF32.9090802@metafoo.de> (raw)
In-Reply-To: <20110511174836.GA22798@sirena.org.uk>
On 05/11/2011 10:48 AM, Mark Brown wrote:
> On Wed, May 11, 2011 at 10:35:37AM -0700, Lars-Peter Clausen wrote:
>
>> I've probably not properly explained the problem in my previous patch.
>> endian.
>
> This is totally unrelated to your previous patch (as is the last one),
> I'm doing some different work on the physical I/O code and frankly
> hadn't thought you had any patches you hadn't resent and got applied
> yet.
Ok, since the patches were basically identical to the patches I send the other
week, I thought they were related.
>
>> The problem is due to how 16-bit SPI transfers work on linux and how
>> snd_soc_cache stores the data which is going to be send.
>
> We shouldn't be using 16 bit transfers at all, that's insane. If the
> board has gone and done that that's silly, and if drivers are relying
> on the board having done that then it's at best incredibly fragile.
> There certainly aren't any which check the word size.
>
>> ASoC though uses a u8 array. So when this array is interpreted as a u16 array
>> instead the values will be in big-endian. As a result using 16-bit spi
>> transfers on a little-endian machine will send out the data byte-swapped.
>> Your patch does not change since.
>
> Right, if the SPI controllers are being set up with anything other than
> 8 bit word sizes in transfers this is going to fall over. However,
> since we can't rely on SPI controllers supporting anything other than 8
> bit transfers and we don't currently have a sensible way of negotiating
> the word size with the controller driver anyway I'd really expect us to
> only ever use 8 bit words without a bunch more infrastructure work.
Ok, could you comment again on this[1] then?
Because what the patch did was switching the codec from 16-bit to 8-bit
transfers, because of the issues described above.
Thanks
- Lars
[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2011-May/039469.html
next prev parent reply other threads:[~2011-05-11 18:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-11 11:53 [PATCH 1/2] ASoC: Remove byte swap in 4x12 SPI write Mark Brown
2011-05-11 11:53 ` [PATCH 2/2] ASoC: Use spi_write() for SPI writes Mark Brown
2011-05-11 17:16 ` Lars-Peter Clausen
2011-05-11 17:24 ` Mark Brown
2011-05-11 13:37 ` [PATCH 1/2] ASoC: Remove byte swap in 4x12 SPI write Liam Girdwood
2011-05-11 17:35 ` Lars-Peter Clausen
2011-05-11 17:48 ` Mark Brown
2011-05-11 18:02 ` Lars-Peter Clausen [this message]
2011-05-11 18:05 ` Mark Brown
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=4DCACF32.9090802@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@slimlogic.co.uk \
--cc=patches@opensource.wolfsonmicro.com \
--cc=vapier.adi@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.