Skip to contentSkip to conversation

iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting

PATCH Applied Chris Lesiak 3 participants 3 messages Nov 21, 2019 – Nov 23, 2019 1 message not in the archive IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting

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.

---
 drivers/iio/humidity/hdc100x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/hdc100x.c +1 -1
index 066e05f92081..ff6666ac5d68 100644
@@ -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;
 		}
Signature · 1 line
2.21.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · 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.

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

Quoted 21 lines
---
 drivers/iio/humidity/hdc100x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/hdc100x.c +1 -2
index 066e05f92081..ff6666ac5d68 100644
@@ -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

A message that is not in the archive (sent off-list or not yet received): CAKzfze9iEi2ZWjWO=OE5Jm+rRrjyE5O6K34pJXfRCMvOt3qLbA@mail.gmail.com

maintainer Applied
#3 lore raw
Quoted 11 lines · On Thu, 21 Nov 2019 18:52:26 -0800 Matt Ranostay <[email protected]> wrote:
Quoted 5 lines · 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.

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

Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

Quoted 25 lines
Quoted 25 lines
---
 drivers/iio/humidity/hdc100x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/hdc100x.c +1 -2
index 066e05f92081..ff6666ac5d68 100644
@@ -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