Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting
@ 2019-11-21 20:39 Chris Lesiak
  2019-11-22  3:25 ` Matt Ranostay
       [not found] ` <CAKzfze9iEi2ZWjWO=OE5Jm+rRrjyE5O6K34pJXfRCMvOt3qLbA@mail.gmail.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Lesiak @ 2019-11-21 20:39 UTC (permalink / raw)
  To: linux-iio, Jonathan Cameron, Matt Ranostay; +Cc: Chris Lesiak

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


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

* Re: [PATCH] iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting
  2019-11-21 20:39 [PATCH] iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting Chris Lesiak
@ 2019-11-22  3:25 ` Matt Ranostay
       [not found] ` <CAKzfze9iEi2ZWjWO=OE5Jm+rRrjyE5O6K34pJXfRCMvOt3qLbA@mail.gmail.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Ranostay @ 2019-11-22  3:25 UTC (permalink / raw)
  To: Chris Lesiak; +Cc: linux-iio, Jonathan Cameron

On Thu, Nov 21, 2019 at 12:39 PM Chris Lesiak <chris.lesiak@licor.com> wrote:
>
> 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.
>

 **sigh** another failure by me to follow the iio ABI.

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> 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
>

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

* Re: [PATCH] iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting
       [not found] ` <CAKzfze9iEi2ZWjWO=OE5Jm+rRrjyE5O6K34pJXfRCMvOt3qLbA@mail.gmail.com>
@ 2019-11-23 16:47   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2019-11-23 16:47 UTC (permalink / raw)
  To: Matt Ranostay; +Cc: Chris Lesiak, linux-iio

On Thu, 21 Nov 2019 18:52:26 -0800
Matt Ranostay <mranostay@gmail.com> wrote:

> On Thu, Nov 21, 2019 at 12:39 PM Chris Lesiak <chris.lesiak@licor.com>
> wrote:
> 
> > 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.
> >
> >  
> **sigh** another failure by me to follow the iio ABI.
> 
> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> 
> 
> > 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
> >
> >  


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 20:39 [PATCH] iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting Chris Lesiak
2019-11-22  3:25 ` Matt Ranostay
     [not found] ` <CAKzfze9iEi2ZWjWO=OE5Jm+rRrjyE5O6K34pJXfRCMvOt3qLbA@mail.gmail.com>
2019-11-23 16:47   ` Jonathan Cameron

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git