Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-10-03 Thread Mark Brown
On Fri, Sep 27, 2013 at 04:34:27PM +0200, Lars-Peter Clausen wrote: > This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16() > except that it converts the read data word from big endian to native > endianness > before returning it. The reason for introducing this new helper

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-10-03 Thread Mark Brown
On Thu, Oct 03, 2013 at 12:39:35PM +0200, Lars-Peter Clausen wrote: > On 09/29/2013 02:30 PM, Mark Brown wrote: > > I think that's probably the way to go, the API seems to error prone as > > it is. > It looks as if for the ads7871 the wire order is actually little endian. Why do hardware

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-10-03 Thread Lars-Peter Clausen
On 09/29/2013 02:30 PM, Mark Brown wrote: > On Fri, Sep 27, 2013 at 10:01:36PM +0200, Lars-Peter Clausen wrote: >> On 09/27/2013 09:22 PM, Mark Brown wrote: > >>> Indeed. I don't think that's terribly well thought through though, >>> especially not now we have annotations for endianness (as you

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-10-03 Thread Lars-Peter Clausen
On 09/29/2013 02:30 PM, Mark Brown wrote: On Fri, Sep 27, 2013 at 10:01:36PM +0200, Lars-Peter Clausen wrote: On 09/27/2013 09:22 PM, Mark Brown wrote: Indeed. I don't think that's terribly well thought through though, especially not now we have annotations for endianness (as you noticed!).

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-10-03 Thread Mark Brown
On Thu, Oct 03, 2013 at 12:39:35PM +0200, Lars-Peter Clausen wrote: On 09/29/2013 02:30 PM, Mark Brown wrote: I think that's probably the way to go, the API seems to error prone as it is. It looks as if for the ads7871 the wire order is actually little endian. Why do hardware engineers

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-10-03 Thread Mark Brown
On Fri, Sep 27, 2013 at 04:34:27PM +0200, Lars-Peter Clausen wrote: This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16() except that it converts the read data word from big endian to native endianness before returning it. The reason for introducing this new helper is

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-29 Thread Mark Brown
On Fri, Sep 27, 2013 at 10:01:36PM +0200, Lars-Peter Clausen wrote: > On 09/27/2013 09:22 PM, Mark Brown wrote: > > Indeed. I don't think that's terribly well thought through though, > > especially not now we have annotations for endianness (as you noticed!). > I wouldn't mind updating

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-29 Thread Mark Brown
On Fri, Sep 27, 2013 at 10:01:36PM +0200, Lars-Peter Clausen wrote: On 09/27/2013 09:22 PM, Mark Brown wrote: Indeed. I don't think that's terribly well thought through though, especially not now we have annotations for endianness (as you noticed!). I wouldn't mind updating spi_w8r16() to

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Guenter Roeck
On Fri, Sep 27, 2013 at 08:22:33PM +0100, Mark Brown wrote: > 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 > > *

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Lars-Peter Clausen
On 09/27/2013 09:22 PM, Mark Brown wrote: > 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

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Mark Brown
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

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Lars-Peter Clausen
On 09/27/2013 08:34 PM, Mark Brown wrote: > On Fri, Sep 27, 2013 at 04:34:27PM +0200, Lars-Peter Clausen wrote: >> This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16() >> except that it converts the read data word from big endian to native >> endianness >> before returning

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Mark Brown
On Fri, Sep 27, 2013 at 04:34:27PM +0200, Lars-Peter Clausen wrote: > This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16() > except that it converts the read data word from big endian to native > endianness > before returning it. The reason for introducing this new helper

[PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Lars-Peter Clausen
This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16() except that it converts the read data word from big endian to native endianness before returning it. The reason for introducing this new helper is that for SPI slave devices it is quite common that the read 16 bit data

[PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Lars-Peter Clausen
This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16() except that it converts the read data word from big endian to native endianness before returning it. The reason for introducing this new helper is that for SPI slave devices it is quite common that the read 16 bit data

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Mark Brown
On Fri, Sep 27, 2013 at 04:34:27PM +0200, Lars-Peter Clausen wrote: This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16() except that it converts the read data word from big endian to native endianness before returning it. The reason for introducing this new helper is

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Lars-Peter Clausen
On 09/27/2013 08:34 PM, Mark Brown wrote: On Fri, Sep 27, 2013 at 04:34:27PM +0200, Lars-Peter Clausen wrote: This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16() except that it converts the read data word from big endian to native endianness before returning it. The

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Mark Brown
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,

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Lars-Peter Clausen
On 09/27/2013 09:22 PM, Mark Brown wrote: 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

Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

2013-09-27 Thread Guenter Roeck
On Fri, Sep 27, 2013 at 08:22:33PM +0100, Mark Brown wrote: 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.