]> asedeno.scripts.mit.edu Git - linux.git/commit
iio: imu: st_lsm6dsx: fix decimation factor estimation
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 28 Nov 2019 15:55:18 +0000 (17:55 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 8 Dec 2019 18:10:30 +0000 (18:10 +0000)
commit5685b145c138b2ca696076106d0fb87b7b90b14a
treefe9291b3f199955da5e0b2a265c789609ef719eb
parent53eaa9c27fdc01b4f4d885223e29f97393409e7e
iio: imu: st_lsm6dsx: fix decimation factor estimation

Fix decimation factor and sip estimation for LSM6DSM series
(max value for decimation factor is 32).
If gyro and accel sensors are enabled at 12.5Hz and 416Hz
respectively, decimation factor lookup will fail, producing
unaligned data.
Remove unused decimator filed in st_lsm6dsx_sensor structure.

Fixes: f8710f0357bc ("iio: imu: st_lsm6dsx: express odr in mHZ")
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