mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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: c9180b8e39 ("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>
This commit is contained in:
committed by
Jonathan Cameron
parent
3af0c1fb1c
commit
7b8dc11c0a
@@ -301,9 +301,9 @@ static int hdc3020_read_raw(struct iio_dev *indio_dev,
|
||||
case IIO_CHAN_INFO_SCALE:
|
||||
*val2 = 65536;
|
||||
if (chan->type == IIO_TEMP)
|
||||
*val = 175;
|
||||
*val = 175 * MILLI;
|
||||
else
|
||||
*val = 100;
|
||||
*val = 100 * MILLI;
|
||||
return IIO_VAL_FRACTIONAL;
|
||||
|
||||
case IIO_CHAN_INFO_OFFSET:
|
||||
|
||||
Reference in New Issue
Block a user