Skip to content

Commit 7b8dc11

Browse files
DimitriFedraujic23
authored andcommitted
iio: humditiy: hdc3020: fix units for temperature and humidity measurement
According to the ABI the units after application of scale and offset are milli degrees for temperature measurements and milli percent for relative humidity measurements. Currently the resulting units are degree celsius for temperature measurements and percent for relative humidity measurements. Change scale factor to fix this issue. Fixes: c9180b8 ("iio: humidity: Add driver for ti HDC302x humidity sensors") Reported-by: Chris Lesiak <chris.lesiak@licorbio.com> Suggested-by: Chris Lesiak <chris.lesiak@licorbio.com> Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 3af0c1f commit 7b8dc11

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/iio/humidity/hdc3020.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,9 @@ static int hdc3020_read_raw(struct iio_dev *indio_dev,
301301
case IIO_CHAN_INFO_SCALE:
302302
*val2 = 65536;
303303
if (chan->type == IIO_TEMP)
304-
*val = 175;
304+
*val = 175 * MILLI;
305305
else
306-
*val = 100;
306+
*val = 100 * MILLI;
307307
return IIO_VAL_FRACTIONAL;
308308

309309
case IIO_CHAN_INFO_OFFSET:

0 commit comments

Comments
 (0)