[PATCH 0/2] iio: imu: st_lsm6dsx: Decouple sensor ODR from FIFO batch data rate

Francesco Lavra
2025-10-09T17:36:11Z

The rate at which accelerometer or gyroscope sensor samples are fed
to the hardware FIFO (batch data rate, or BDR) does not have to
coincide with the sensor sampling frequency (output data rate, or
ODR); the only requirement is for the BDR to not be greater than
the ODR. Having a BDR lower than the ODR is useful in cases where
an application requires a high sampling rate for accurate detection
of motion events (e.g. wakeup events), but wants to read sensor
sample values from the device buffer at a lower data rate.
This change set amends the st_lsm6dsx IIO driver to support the above
use case. The first commit is a trivial fix to the source code comment
that indicates what measurement unit is used for the `odr` field of
struct st_lsm6ds_sensor, while the second commit introduces a new `bdr`
field in the same struct to implement the new functionality.

Francesco Lavra (2):
iio: imu: st_lsm6dsx: Fix measurement unit for odr struct member
iio: imu: st_lsm6dsx: Decouple sensor ODR from FIFO batch data rate

drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 4 +-
.../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 64 ++++++++++++++++---
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 9 ++-
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 4 +-
4 files changed, 67 insertions(+), 14 deletions(-)

--
2.39.5