• Lorenzo Bianconi's avatar
    iio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handler · 2ccc1503
    Lorenzo Bianconi authored
    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: 290a6ce1 (iio: imu: add support to lsm6dsx driver)
    Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@st.com>
    Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
    2ccc1503
st_lsm6dsx_core.c 18.2 KB