iio: invensense: fix timestamp glitches when switching frequency
authorJean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Fri, 26 Apr 2024 09:48:35 +0000 (09:48 +0000)
committerJonathan Cameron <jonathan.cameron@huawei.com>
Fri, 3 May 2024 10:48:56 +0000 (11:48 +0100)
commitbf8367b00c33c64a9391c262bb2e11d274c9f2a4
tree573de3f6937ed28b9c5cec06fb001536082264c1
parent0340dc4c82590d8735c58cf904a8aa1173273ab5
iio: invensense: fix timestamp glitches when switching frequency

When a sensor is running and there is a FIFO frequency change due to
another sensor turned on/off, there are glitches on timestamp. Fix that
by using only interrupt timestamp when there is the corresponding sensor
data in the FIFO.

Delete FIFO period handling and simplify internal functions.

Update integration inside inv_mpu6050 and inv_icm42600 drivers.

Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")
Cc: Stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20240426094835.138389-1-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
include/linux/iio/common/inv_sensors_timestamp.h