]> 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)
commit785310c431c86fbcb8b0e0a356ccf73548ba731c
treeeeddc87b33d4447c623f481e11efd63a9273d54e
parent74b2863fbd8f5d1b903856a47028d82faa19238f
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: 58903be79d82 (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