From: Matt Ranostay Date: Fri, 27 May 2016 02:55:06 +0000 (-0700) Subject: iio: humidity: hdc100x: fix IIO_TEMP channel reporting X-Git-Tag: firefly_0821_release~176^2~4^2~37^2~43 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d2be6f6172de75b807b48ef391fb7542402f554e;p=firefly-linux-kernel-4.4.55.git iio: humidity: hdc100x: fix IIO_TEMP channel reporting 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 Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c index f24282635161..1b31841f3039 100644 --- a/drivers/iio/humidity/hdc100x.c +++ b/drivers/iio/humidity/hdc100x.c @@ -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 {