iio: humidity: hdc100x: fix IIO_TEMP channel reporting
authorMatt Ranostay <mranostay@gmail.com>
Fri, 27 May 2016 02:55:06 +0000 (19:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2016 16:47:36 +0000 (09:47 -0700)
commit 09bc0ddaab6cab0fa95a67d5535ec772e2671193 upstream.

IIO_TEMP channel was being incorrectly reported back as Celsius when it
should have been milliCelsius. This is via an incorrect scale value being
returned to userspace.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/humidity/hdc100x.c

index f2428263516149019bc9e9462c08618f2429a390..1b31841f30393de923ebd6a647ee41ab87b3be86 100644 (file)
@@ -211,7 +211,7 @@ static int hdc100x_read_raw(struct iio_dev *indio_dev,
                return IIO_VAL_INT_PLUS_MICRO;
        case IIO_CHAN_INFO_SCALE:
                if (chan->type == IIO_TEMP) {
-                       *val = 165;
+                       *val = 165000;
                        *val2 = 65536 >> 2;
                        return IIO_VAL_FRACTIONAL;
                } else {