[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a3bc95f4a16f876925cfc157aaf5d78f3dbc513d.1681301472.git.mazziesaccount@gmail.com>
Date: Wed, 12 Apr 2023 15:29:01 +0300
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Matti Vaittinen <mazziesaccount@...il.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
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@...il.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 =]
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists