iio: imu: inv_mpu6050: read the full fifo when processing data
authorJean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Fri, 23 Jun 2023 08:29:24 +0000 (08:29 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 20 Jul 2023 18:21:30 +0000 (19:21 +0100)
commit0829edc43e0a2bf9e417fb5fa2ba00f0ea031c5b
tree30259771f6b61c5f8b6da205afbc7e3b4eb4c91a
parent21a12e614be02084cd40c66c921a470e37096281
iio: imu: inv_mpu6050: read the full fifo when processing data

When processing data read the full fifo data in 1 time. If there
are several samples in the FIFO, it means we are experiencing
system delay. In this case, it is better to read all data with 1
bus access than to add additional latency by doing several ones.

This requires to use a bigger buffer depending on chip FIFO size
and do an additional local data copy before sending. But the cost
is minimal and behavior is still better like this under system
heavy load.

Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20230623082924.283967-1-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c