iio: imu: inv_icm42600: fix timestamp reset
authorJean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Tue, 9 May 2023 15:22:02 +0000 (15:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:18 +0000 (10:34 +0200)
commitcb2a612c397d3c7d318f6aa0104480dfdd1a808d
treee964f93cab2d946114204eb2a55dea26e1ec65d9
parent3fb021f5c1144073398404bc47c7f4a282311d86
iio: imu: inv_icm42600: fix timestamp reset

commit bbaae0c79ebd49f61ad942a8bf9e12bfc7f821bb upstream.

Timestamp reset is not done in the correct place. It must be done
before enabling buffer. The reason is that interrupt timestamping
is always happening when the chip is on, even if the
corresponding sensor is off. When the sensor restarts, timestamp
is wrong if you don't do a reset first.

Fixes: ec74ae9fd37c ("iio: imu: inv_icm42600: add accurate timestamping")
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230509152202.245444-1-inv.git-commit@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c