On Mon, 21 Oct 2024 10:38:42 +0200 Jean-Baptiste Maneyrol via B4 Relay devnull+jean-baptiste.maneyrol.tdk.com@kernel.org wrote:
From: Jean-Baptiste Maneyrol jean-baptiste.maneyrol@tdk.com
When multiple ODR switch happens during FIFO off, the change could not be taken into account if you get back to previous FIFO on value. For example, if you run sensor buffer at 50Hz, stop, change to 200Hz, then back to 50Hz and restart buffer, data will be timestamped at 200Hz. This due to testing against mult and not new_mult.
To prevent this, let's just run apply_odr automatically when FIFO is off. It will also simplify driver code.
Update inv_mpu6050 and inv_icm42600 to delete now useless apply_odr.
Fixes: 95444b9eeb8c ("iio: invensense: fix odr switching to same value") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol jean-baptiste.maneyrol@tdk.com
Applied to the fixes-togreg branch of iio.git
Depending on what else comes in and timing, I might move this over to the queue for the next merge window.
Thanks,
Jonathan