]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:35 +0000 (14:22 -0300)
BugLink: https://bugs.launchpad.net/bugs/1857158
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: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/iio/humidity/hdc100x.c

index d8438310b6d4d7a533506523611d01a589fdd961..b9300cb8a0eac3117c2f84c0f33f75723db2596a 100644 (file)
@@ -237,7 +237,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;
                }