From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
According to the ABI the units after application of scale and offset are
milli degrees for temperature measurements and milli percent for relative
humidity measurements. Change scale factor to fix this issue.
Fixes: c9180b8e39be ("iio: humidity: Add driver for ti HDC302x humidity sensors")
Reported-by: Chris Lesiak <chris.lesiak@licorbio.com>
Suggested-by: Chris Lesiak <chris.lesiak@licorbio.com>
Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
---
drivers/iio/humidity/hdc3020.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/humidity/hdc3020.c b/drivers/iio/humidity/hdc3020.c
index ffb25596d3a8bad01d1f84a9a972561266f65d76..9de52de628e04263a2b62a512a36203d6c02c5e0 100644
--- a/drivers/iio/humidity/hdc3020.c
+++ b/drivers/iio/humidity/hdc3020.c
@@ -301,9 +301,9 @@ static int hdc3020_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_SCALE:
*val2 = 65536;
if (chan->type == IIO_TEMP)
- *val = 175;
+ *val = 175000;
else
- *val = 100;
+ *val = 100000;
return IIO_VAL_FRACTIONAL;
case IIO_CHAN_INFO_OFFSET:
--
2.39.5
On Thu, Aug 21, 2025 at 05:23:54PM +0200, Dimitri Fedrau via B4 Relay wrote: > From: Dimitri Fedrau <dimitri.fedrau@liebherr.com> > > According to the ABI the units after application of scale and offset are > milli degrees for temperature measurements and milli percent for relative > humidity measurements. Change scale factor to fix this issue. ... > if (chan->type == IIO_TEMP) > - *val = 175; > + *val = 175000; > else > - *val = 100; > + *val = 100000; Perhaps use " * MILL" uin both cases? -- With Best Regards, Andy Shevchenko
On Thu, Aug 21, 2025 at 06:44:25PM +0300, Andy Shevchenko wrote: > On Thu, Aug 21, 2025 at 05:23:54PM +0200, Dimitri Fedrau via B4 Relay wrote: ... > > if (chan->type == IIO_TEMP) > > - *val = 175; > > + *val = 175000; > > else > > - *val = 100; > > + *val = 100000; > Perhaps use " * MILL" uin both cases? Perhaps use " * MILLI" in both cases? -- With Best Regards, Andy Shevchenko
Am Thu, Aug 21, 2025 at 06:45:02PM +0300 schrieb Andy Shevchenko: > On Thu, Aug 21, 2025 at 06:44:25PM +0300, Andy Shevchenko wrote: > > On Thu, Aug 21, 2025 at 05:23:54PM +0200, Dimitri Fedrau via B4 Relay wrote: > > ... > > > > if (chan->type == IIO_TEMP) > > > - *val = 175; > > > + *val = 175000; > > > else > > > - *val = 100; > > > + *val = 100000; > > > Perhaps use " * MILL" uin both cases? > > Perhaps use " * MILLI" in both cases? > > Ok. Best regards, Dimitri Fedrau
© 2016 - 2025 Red Hat, Inc.