patch "iio: imu: st_lsm6dsx: set 10ms as min shub slave timeout" added to staging-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
iio: imu: st_lsm6dsx: set 10ms as min shub slave timeout
to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From fe0b980ffd1dd8b10c09f82385514819ba2a661d Mon Sep 17 00:00:00 2001
From: Lorenzo Bianconi <[email protected]>
Date: Sun, 1 Nov 2020 17:21:18 +0100
Subject: iio: imu: st_lsm6dsx: set 10ms as min shub slave timeout
Set 10ms as minimum i2c slave configuration timeout since st_lsm6dsx relies on accel ODR for i2c master clock and at high sample rates (e.g. 833Hz or 416Hz) the slave sensor occasionally may need more cycles than i2c master timeout (2s/833Hz + 1 ~ 3ms) to apply the configuration resulting in an uncomplete slave configuration and a constant reading from the i2c slave connected to st_lsm6dsx i2c master.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c +4 -2
@@ -156,11 +156,13 @@ static const struct st_lsm6dsx_ext_dev_settings st_lsm6dsx_ext_dev_table[] = {static void st_lsm6dsx_shub_wait_complete (struct st_lsm6dsx_hw *hw) {struct st_lsm6dsx_sensor *sensor; -u32 odr; +u32 odr, timeout; sensor =iio_priv (hw->iio_devs[ST_LSM6DSX_ID_ACC ]); odr = (hw->enable_mask &BIT (ST_LSM6DSX_ID_ACC )) ? sensor->odr :12500 ; -msleep ((2000000U / odr) +1 ); +/* set 10ms as minimum timeout for i2c slave configuration */ + timeout =max_t (u32,2000000U / odr +1 ,10 ); +msleep (timeout); }/*
Signature · 1 line
2.29.2