iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 5 Feb 2022 21:57:42 +0000 (22:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Mar 2022 10:48:04 +0000 (11:48 +0100)
commit1f05c75684455f1fd0c43637f5c86981a3f80a81
tree6014d90c4474cd5e134bb8b2d551654efbe3d011
parentc77f4ae7bd43721ce8ea94147309d7f755707ce6
iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot

commit ea85bf906466191b58532bb19f4fbb4591f0a77e upstream.

We need to wait for sensor settling time (~ 3/ODR) before reading data
in st_lsm6dsx_read_oneshot routine in order to avoid corrupted samples.

Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver")
Reported-by: Mario Tesi <mario.tesi@st.com>
Tested-by: Mario Tesi <mario.tesi@st.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/b41ebda5535895298716c76d939f9f165fcd2d13.1644098120.git.lorenzo@kernel.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c