From d3a21ce0c60365991e59bbe848457c08f0c3c7ca Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sat, 26 Sep 2015 23:18:57 -0700 Subject: [PATCH] iio: hdc100x: correct IIO_CHAN_INFO_OFFSET value Previous offset wasn't applied in the correct order and invalid. This patchset fixes this issue, and also has the correct scale value applied to the offset. Signed-off-by: Matt Ranostay Signed-off-by: Jonathan Cameron --- drivers/iio/humidity/hdc100x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c index 28245782ecfb..a7f61e881a49 100644 --- a/drivers/iio/humidity/hdc100x.c +++ b/drivers/iio/humidity/hdc100x.c @@ -221,8 +221,9 @@ static int hdc100x_read_raw(struct iio_dev *indio_dev, } break; case IIO_CHAN_INFO_OFFSET: - *val = -40; - return IIO_VAL_INT; + *val = -3971; + *val2 = 879096; + return IIO_VAL_INT_PLUS_MICRO; default: return -EINVAL; } -- 2.34.1