diff options
author | Dimitri Fedrau <dima.fedrau@gmail.com> | 2024-01-26 14:52:26 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-01-27 15:40:07 +0100 |
commit | a69eeaad093dd2c8fd0b216c8143b380b73d672d (patch) | |
tree | d7f36446682b4829c2bccb170fdcc9f4e3145260 | |
parent | iio: adc: ad7091r8: Fix error code in ad7091r8_gpio_setup() (diff) | |
download | linux-a69eeaad093dd2c8fd0b216c8143b380b73d672d.tar.xz linux-a69eeaad093dd2c8fd0b216c8143b380b73d672d.zip |
iio: humidity: hdc3020: fix temperature offset
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>
-rw-r--r-- | drivers/iio/humidity/hdc3020.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/humidity/hdc3020.c b/drivers/iio/humidity/hdc3020.c index 4e3311170725..ed70415512f6 100644 --- a/drivers/iio/humidity/hdc3020.c +++ b/drivers/iio/humidity/hdc3020.c @@ -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: |