iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting
authorChris Lesiak <chris.lesiak@licor.com>
Thu, 21 Nov 2019 20:39:42 +0000 (20:39 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 8 Dec 2019 18:10:29 +0000 (18:10 +0000)
The IIO_HUMIDITYRELATIVE channel was being incorrectly reported back
as percent when it should have been milli percent. This is via an
incorrect scale value being returned to userspace.

Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/humidity/hdc100x.c

index 963ff04..7ecd2ff 100644 (file)
@@ -229,7 +229,7 @@ static int hdc100x_read_raw(struct iio_dev *indio_dev,
                        *val2 = 65536;
                        return IIO_VAL_FRACTIONAL;
                } else {
-                       *val = 100;
+                       *val = 100000;
                        *val2 = 65536;
                        return IIO_VAL_FRACTIONAL;
                }