lkml.org 
[lkml]   [2013]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] spi: Add a spi_w8r16be() helper
On Fri, Sep 27, 2013 at 08:46:56PM +0200, Lars-Peter Clausen wrote:

> According to the documentation of spi_w8r16() it is a feature.

> * The number is returned in wire-order, which is at least sometimes
> * big-endian.

Indeed. I don't think that's terribly well thought through though,
especially not now we have annotations for endianness (as you noticed!).

> There seem to be at least two users though which assume that the result is
> in native endianness drivers/hwmon/ads7871.c and drivers/mfd/stmpe-spi.c

Yeah, I saw. The ads7871 is just going to break when run on the
opposite endianness to the one it was (hopefully) tested on since it
doesn't make any effort I saw to cope with endianness. Looking at the
history it's not terribly obvious which that was but it'd be surprising
to see a little endian register...

STMPE is doing a byte swap so it's another user for your function -
it's for ARM systems so it'll be assuming that little endian is the
native format.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-09-27 21:41    [W:0.050 / U:42.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site