public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Lesiak <chris.lesiak@licor.com>
To: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Matt Ranostay <mranostay@gmail.com>
Cc: Chris Lesiak <chris.lesiak@licor.com>
Subject: [PATCH] iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting
Date: Thu, 21 Nov 2019 20:39:42 +0000	[thread overview]
Message-ID: <20191121203932.17249-1-chris.lesiak@licor.com> (raw)

The IIO_HUMIDITYRELATIVE channel was being incorrectly reported back
as percent when it should have been milli percent. This is via an
incorrect scale value being returned to userspace.

Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
---
 drivers/iio/humidity/hdc100x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c
index 066e05f92081..ff6666ac5d68 100644
--- a/drivers/iio/humidity/hdc100x.c
+++ b/drivers/iio/humidity/hdc100x.c
@@ -229,7 +229,7 @@ static int hdc100x_read_raw(struct iio_dev *indio_dev,
 			*val2 = 65536;
 			return IIO_VAL_FRACTIONAL;
 		} else {
-			*val = 100;
+			*val = 100000;
 			*val2 = 65536;
 			return IIO_VAL_FRACTIONAL;
 		}
-- 
2.21.0


             reply	other threads:[~2019-11-21 20:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 20:39 Chris Lesiak [this message]
2019-11-22  3:25 ` [PATCH] iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting Matt Ranostay
     [not found] ` <CAKzfze9iEi2ZWjWO=OE5Jm+rRrjyE5O6K34pJXfRCMvOt3qLbA@mail.gmail.com>
2019-11-23 16:47   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191121203932.17249-1-chris.lesiak@licor.com \
    --to=chris.lesiak@licor.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mranostay@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox