lkml.org 
[lkml]   [2023]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/3] iio: bu27034: Fix integration time units
The integration time was presented by BU27034 in micro seconds. The ABI
documentation says this should be in seconds.

Fix integration time to be in seconds.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
---
drivers/iio/light/rohm-bu27034.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/light/rohm-bu27034.c b/drivers/iio/light/rohm-bu27034.c
index e486dcf35eba..6044db52abfa 100644
--- a/drivers/iio/light/rohm-bu27034.c
+++ b/drivers/iio/light/rohm-bu27034.c
@@ -1171,7 +1171,7 @@ static int bu27034_read_raw(struct iio_dev *idev,
if (*val < 0)
return *val;

- return IIO_VAL_INT;
+ return IIO_VAL_INT_MICRO;

case IIO_CHAN_INFO_SCALE:
return bu27034_get_scale(data, chan->channel, val, val2);
@@ -1229,7 +1229,10 @@ static int bu27034_write_raw(struct iio_dev *idev,
ret = bu27034_set_scale(data, chan->channel, val, val2);
break;
case IIO_CHAN_INFO_INT_TIME:
- ret = bu27034_try_set_int_time(data, val);
+ if (val)
+ return -EINVAL;
+
+ ret = bu27034_try_set_int_time(data, val2);
break;
default:
ret = -EINVAL;
--
2.39.2

--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =]
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-04-12 14:30    [W:0.093 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site