[PATCH 1/2] iio: imu: st_lsm6dsx: Fix measurement unit for odr struct member

Francesco Lavra posted 2 patches 3 months, 3 weeks ago
There is a newer version of this series
[PATCH 1/2] iio: imu: st_lsm6dsx: Fix measurement unit for odr struct member
Posted by Francesco Lavra 3 months, 3 weeks ago
The `odr` field in struct st_lsm6dsx_sensor contains a data rate
value expressed in mHz, not in Hz.

Fixes: 290a6ce11d938 ("iio: imu: add support to lsm6dsx driver")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index c225b246c8a5..bd366c6e282a 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -365,7 +365,7 @@ enum st_lsm6dsx_fifo_mode {
  * @id: Sensor identifier.
  * @hw: Pointer to instance of struct st_lsm6dsx_hw.
  * @gain: Configured sensor sensitivity.
- * @odr: Output data rate of the sensor [Hz].
+ * @odr: Output data rate of the sensor [mHz].
  * @samples_to_discard: Number of samples to discard for filters settling time.
  * @watermark: Sensor watermark level.
  * @decimator: Sensor decimation factor.
-- 
2.39.5
Re: [PATCH 1/2] iio: imu: st_lsm6dsx: Fix measurement unit for odr struct member
Posted by Lorenzo Bianconi 3 months, 3 weeks ago
> The `odr` field in struct st_lsm6dsx_sensor contains a data rate
> value expressed in mHz, not in Hz.
> 
> Fixes: 290a6ce11d938 ("iio: imu: add support to lsm6dsx driver")
> Signed-off-by: Francesco Lavra <flavra@baylibre.com>

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index c225b246c8a5..bd366c6e282a 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -365,7 +365,7 @@ enum st_lsm6dsx_fifo_mode {
>   * @id: Sensor identifier.
>   * @hw: Pointer to instance of struct st_lsm6dsx_hw.
>   * @gain: Configured sensor sensitivity.
> - * @odr: Output data rate of the sensor [Hz].
> + * @odr: Output data rate of the sensor [mHz].
>   * @samples_to_discard: Number of samples to discard for filters settling time.
>   * @watermark: Sensor watermark level.
>   * @decimator: Sensor decimation factor.
> -- 
> 2.39.5
> 
Re: [PATCH 1/2] iio: imu: st_lsm6dsx: Fix measurement unit for odr struct member
Posted by Francesco Lavra 3 months, 3 weeks ago
On Thu, 2025-10-16 at 22:13 +0200, Lorenzo Bianconi wrote:
> > The `odr` field in struct st_lsm6dsx_sensor contains a data rate
> > value expressed in mHz, not in Hz.
> > 
> > Fixes: 290a6ce11d938 ("iio: imu: add support to lsm6dsx driver")

I just learned that odr values used to be expressed in Hz in past versions
of the driver, so the right commit for the Fixes: tag is f8710f0357bc3
("iio: imu: st_lsm6dsx: express odr in mHZ"). Will correct this in v3.

> > Signed-off-by: Francesco Lavra <flavra@baylibre.com>
> 
> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>