summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorChris Lesiak <chris.lesiak@licor.com>2019-11-21 20:39:42 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-21 10:35:12 +0100
commit221123c54029af96aaf1ee896b1ab0165f712d61 (patch)
treee8e0ab7f5e2000e8d915b5001df8c6db54959e47 /drivers/iio
parent88569efc8a66caa73e8c6168406f6f85aaeac432 (diff)
iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting
commit 342a6928bd5017edbdae376042d8ad6af3d3b943 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/humidity/hdc100x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c
index dc5e7e70f951..7731e0f1e104 100644
--- a/drivers/iio/humidity/hdc100x.c
+++ b/drivers/iio/humidity/hdc100x.c
@@ -215,7 +215,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;
}