]> git.baikalelectronics.ru Git - kernel.git/commit
iio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handler
authorLorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Sun, 2 Apr 2017 12:58:45 +0000 (14:58 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 2 Apr 2017 13:36:06 +0000 (14:36 +0100)
commitccb6af564962c18cd514d24e9d6479197b6db396
treeeeddc87b33d4447c623f481e11efd63a9273d54e
parentf8f410bc963883acc6a17e6c12493fe7ede5d6d5
iio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handler

This patch allows to avoid a transitory that occurs when a given sensor
has been already enabled (e.g. gyroscope) and the user is configuring
the sample frequency of the other one (e.g. accelerometer).
The transitory lasts until the accelerometer is enabled.
During that time slice the gyroscope ODR is incorrectly modified as well.
At the end of the transitory both sensors work at the right frequency.
Fix it introducing st_lsm6dsx_check_odr() routine to check ODR consistency
in write_raw handler in order to apply frequency configuration just
in st_lsm6dsx_set_odr()

Fixes: 98d8c8774fe4 (iio: imu: add support to lsm6dsx driver)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c