Commit d2be6f61 authored by Matt Ranostay's avatar Matt Ranostay Committed by Greg Kroah-Hartman

iio: humidity: hdc100x: fix IIO_TEMP channel reporting

commit 09bc0dda upstream.

IIO_TEMP channel was being incorrectly reported back as Celsius when it
should have been milliCelsius. This is via an incorrect scale value being
returned to userspace.
Signed-off-by: default avatarMatt Ranostay <mranostay@gmail.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f7ba3de1
...@@ -211,7 +211,7 @@ static int hdc100x_read_raw(struct iio_dev *indio_dev, ...@@ -211,7 +211,7 @@ static int hdc100x_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT_PLUS_MICRO; return IIO_VAL_INT_PLUS_MICRO;
case IIO_CHAN_INFO_SCALE: case IIO_CHAN_INFO_SCALE:
if (chan->type == IIO_TEMP) { if (chan->type == IIO_TEMP) {
*val = 165; *val = 165000;
*val2 = 65536 >> 2; *val2 = 65536 >> 2;
return IIO_VAL_FRACTIONAL; return IIO_VAL_FRACTIONAL;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment