iio: humidity: hdc3020: fix temperature offset
authorDimitri Fedrau <dima.fedrau@gmail.com>
Fri, 26 Jan 2024 13:52:26 +0000 (14:52 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 27 Jan 2024 14:40:07 +0000 (14:40 +0000)
The temperature offset should be negative according to the datasheet.
Adding a minus to the existing offset results in correct temperature
calculations.

Fixes: c9180b8e39be ("iio: humidity: Add driver for ti HDC302x humidity sensors")
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Link: https://lore.kernel.org/r/20240126135226.3977904-1-dima.fedrau@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/humidity/hdc3020.c

index 4e3311170725bc55fa3a5dd1c2a90dccb6c3aa19..ed70415512f687b6333078f9416b9a0fd6edbfdb 100644 (file)
@@ -322,7 +322,7 @@ static int hdc3020_read_raw(struct iio_dev *indio_dev,
                if (chan->type != IIO_TEMP)
                        return -EINVAL;
 
-               *val = 16852;
+               *val = -16852;
                return IIO_VAL_INT;
 
        default: