iio: imu: st_lsm6dsx: fix read misalignment on untagged FIFO
authorLorenzo Bianconi <lorenzo@kernel.org>
Fri, 13 Mar 2020 17:54:41 +0000 (18:54 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 28 Mar 2020 16:35:02 +0000 (16:35 +0000)
commit7762902c89c4c78d32ec562f1ada44d02039104b
treee20465cbbf6b6301e5b773a3762f9c1f49c3c1a9
parente2042d2936dfc84e9c600fe9b9d0039ca0e54b7d
iio: imu: st_lsm6dsx: fix read misalignment on untagged FIFO

st_lsm6dsx suffers of a read misalignment on untagged FIFO when
all 3 supported sensors (accel, gyro and ext device) are running
at different ODRs (the use-case is reported in the LSM6DSM Application
Note at pag 100).
Fix the issue taking into account decimation factor reading the FIFO
pattern.

Fixes: e485e2a2cfd6 ("iio: imu: st_lsm6dsx: enable sensor-hub support for lsm6dsm")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c