summaryrefslogtreecommitdiff
path: root/drivers/iio/humidity
diff options
context:
space:
mode:
authorDimitri Fedrau <dima.fedrau@gmail.com>2024-01-26 14:52:26 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-01-27 14:40:07 +0000
commita69eeaad093dd2c8fd0b216c8143b380b73d672d (patch)
treed7f36446682b4829c2bccb170fdcc9f4e3145260 /drivers/iio/humidity
parent9c46e3a5232d855a65f440b298a2a66497f799d2 (diff)
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>
Diffstat (limited to 'drivers/iio/humidity')
-rw-r--r--drivers/iio/humidity/hdc3020.c2
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: