Re: [PATCH] iio: humidity: hdc100x: use i2c_master_recv to read sensor data

From: Lars-Peter Clausen
Date: Fri Aug 05 2016 - 05:35:49 EST


On 08/05/2016 01:37 AM, Alison Schofield wrote:
[...]
>
> No, that's not what this bug & patch is about.
>
> This patch is about the fact that we are reading the temp &
> humid data registers incorrectly in the current driver and
> we are exposing incorrect numbers via sysfs raw reads.
>
> I have tried by testing and inspection each read protocol.
> It NAKs all of them - except for read_byte. Problem with
> read_byte is that we are always getting the MSB. We do 2
> consecutive read_bytes, expecting MSB,LSB, but get MSB,MSB.
>
> I have been doing msmts w this driver for quite awhile, and
> to my human eye they looked reasonable in integer format.
> But, once I started looking at the byte level, to test moving
> those bytes into buffers, I saw the unmistakable pattern:
> MSB == LSB always.
>
> Sorry to be the bearer of bad news. I still hold out hope that
> we can fix this with some smbus magic and not 'kill backward
> compatibility'.

If the part is not SMBUS compatible I don't see a reason to try to force it.
It's also not affecting backwards compatibility, the driver never worked
correctly in the first place with SMBUS only, so there is no regression.
After the patch it sill does not work.