Re: [PATCH] iio: si7020: Fix endianness for I2C reads

2015-03-14 Thread Andrey Smirnov
> > i2c_smbus_read_word_data() returns data in native endianess. But it > interprets the word on the bus as little-endian (As specified by the SMBus > spec). If your chip returns data in big-endian use > i2c_smbus_read_word_data_swapped(). > > - Lars Ah, good to know. I'll update the patch

Re: [PATCH] iio: si7020: Fix endianness for I2C reads

2015-03-14 Thread Andrey Smirnov
i2c_smbus_read_word_data() returns data in native endianess. But it interprets the word on the bus as little-endian (As specified by the SMBus spec). If your chip returns data in big-endian use i2c_smbus_read_word_data_swapped(). - Lars Ah, good to know. I'll update the patch accordingly.

Re: [PATCH] iio: si7020: Fix endianness for I2C reads

2015-03-13 Thread Lars-Peter Clausen
On 03/13/2015 03:53 AM, Andrey Smirnov wrote: Si7020 outputs most significant byte of the measurement result first and least significant byte last. As a result the data returned by i2c_smbus_read_word_data appears as big endian. Fix this by making a call to an approbriate byte conversion

Re: [PATCH] iio: si7020: Fix endianness for I2C reads

2015-03-13 Thread Lars-Peter Clausen
On 03/13/2015 03:53 AM, Andrey Smirnov wrote: Si7020 outputs most significant byte of the measurement result first and least significant byte last. As a result the data returned by i2c_smbus_read_word_data appears as big endian. Fix this by making a call to an approbriate byte conversion

[PATCH] iio: si7020: Fix endianness for I2C reads

2015-03-12 Thread Andrey Smirnov
Si7020 outputs most significant byte of the measurement result first and least significant byte last. As a result the data returned by i2c_smbus_read_word_data appears as big endian. Fix this by making a call to an approbriate byte conversion routine. Signed-off-by: Andrey Smirnov ---

[PATCH] iio: si7020: Fix endianness for I2C reads

2015-03-12 Thread Andrey Smirnov
Si7020 outputs most significant byte of the measurement result first and least significant byte last. As a result the data returned by i2c_smbus_read_word_data appears as big endian. Fix this by making a call to an approbriate byte conversion routine. Signed-off-by: Andrey Smirnov