linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: hdc100x: correct IIO_CHAN_INFO_OFFSET value
@ 2015-09-27  6:18 Matt Ranostay
  2015-09-27 13:29 ` Jonathan Cameron
  0 siblings, 1 reply; 10+ messages in thread
From: Matt Ranostay @ 2015-09-27  6:18 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, Matt Ranostay

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 <mranostay@gmail.com>
---
 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 2824578..a7f61e8 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;
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-10-11 12:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-27  6:18 [PATCH] iio: hdc100x: correct IIO_CHAN_INFO_OFFSET value Matt Ranostay
2015-09-27 13:29 ` Jonathan Cameron
2015-09-27 22:35   ` Matt Ranostay
2015-09-28  9:08     ` Jonathan Cameron
2015-09-29  4:19       ` Matt Ranostay
2015-09-29  6:21         ` Matt Ranostay
2015-09-29 17:30           ` Jonathan Cameron
2015-09-29 17:33         ` Jonathan Cameron
2015-10-05  5:57           ` Matt Ranostay
2015-10-11 12:53             ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).