iio: humidity: hdc100x: fix IIO_TEMP channel reporting
authorMatt Ranostay <mranostay@gmail.com>
Fri, 27 May 2016 02:55:06 +0000 (19:55 -0700)
committerJonathan Cameron <jic23@kernel.org>
Sun, 29 May 2016 18:45:54 +0000 (19:45 +0100)
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>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/humidity/hdc100x.c

index 59aa1cb..3070983 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 {