iio: imu: st_lsm6dsx: flush hw FIFO before resetting the device
authorLorenzo Bianconi <lorenzo@kernel.org>
Fri, 13 Mar 2020 18:06:00 +0000 (19:06 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 16:50:01 +0000 (17:50 +0100)
commit3a63da26db0a864134f023f088d41deacd509997
tree4475c56bf2e0f7a36fd5e773a094328a2e4e11b5
parent5403f2807623b2e470c889f8d937e2f1a859251e
iio: imu: st_lsm6dsx: flush hw FIFO before resetting the device

flush hw FIFO before device reset in order to avoid possible races
on interrupt line 1. If the first interrupt line is asserted during
hw reset the device will work in I3C-only mode (if it is supported)

Fixes: 801a6e0af0c6 ("iio: imu: st_lsm6dsx: add support to LSM6DSO")
Fixes: 43901008fde0 ("iio: imu: st_lsm6dsx: add support to LSM6DSR")
Reported-by: Mario Tesi <mario.tesi@st.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Vitor Soares <vitor.soares@synopsys.com>
Tested-by: Vitor Soares <vitor.soares@synopsys.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c