]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
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)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 13:29:12 +0000 (07:29 -0600)
BugLink: https://bugs.launchpad.net/bugs/1858424
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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/iio/humidity/hdc100x.c

index bfe1cdb16846ebb5f32130e105014f2bca3a5cf6..dcf5a5bdfaa8240ea255032bb82cfd3893a304c7 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;
                }