| From 681e4a36795a190cb7411e2dd70ea44fb0cb07a7 Mon Sep 17 00:00:00 2001 |
| From: Chris Lesiak <chris.lesiak@licor.com> |
| Date: Thu, 21 Nov 2019 20:39:42 +0000 |
| Subject: [PATCH] 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: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c |
| index 066e05f92081..ff6666ac5d68 100644 |
| --- a/drivers/iio/humidity/hdc100x.c |
| +++ b/drivers/iio/humidity/hdc100x.c |
| @@ -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; |
| } |
| -- |
| 2.7.4 |
| |