Re: [PATCH 3/3] iio: imu: st_lsm6dsx: add support for rotation sensor
From: Jonathan Cameron
Date: Sun Jan 11 2026 - 14:39:19 EST
On Fri, 9 Jan 2026 21:22:09 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Fri, Jan 09, 2026 at 07:15:28PM +0100, Francesco Lavra wrote:
> > Some IMU chips in the LSM6DSX family have sensor fusion features that
> > combine data from the accelerometer and gyroscope. One of these features
> > generates rotation vector data and makes it available in the hardware
> > FIFO as a quaternion (more specifically, the X, Y and Z components of the
> > quaternion vector, expressed as 16-bit half-precision floating-point
> > numbers).
> >
> > Add support for a new sensor instance that allows receiving sensor fusion
> > data, by defining a new struct st_lsm6dsx_sf_settings (which contains
> > chip-specific details for the sensor fusion functionality), and adding this
> > struct as a new field in struct st_lsm6dsx_settings. In st_lsm6dsx_core.c,
> > populate this new struct for the LSM6DSV and LSM6DSV16X chips, and add the
> > logic to initialize an additional IIO device if this struct is populated
> > for the hardware type being probed.
> > Note: a new IIO device is being defined (as opposed to adding channels to
> > an existing device) because each of the existing devices handles data
> > coming from a single sensor, while sensor fusion data comes from multiple
> > sensors.
> >
> > Tested on LSMDSV16X.
>
> ...
>
> > enum st_lsm6dsx_sensor_id {
>
> > ST_LSM6DSX_ID_EXT0,
> > ST_LSM6DSX_ID_EXT1,
> > ST_LSM6DSX_ID_EXT2,
> > + ST_LSM6DSX_ID_SF,
> > ST_LSM6DSX_ID_MAX,
>
> At some point please either get rid of _ID_MAX, or drop the trailing comma
> (maybe some other places also need the same treatment).
It's already gone, this needs a rebase on the upstream
tree.
Thanks,
Jonathan