drivers/sensor: lsm6dso: Prevent device entering I3C

On LSM6DSO sensor the INT1 pin is used for both generating the drdy
interrupt and for switching to I3C hotjoin mode just after reset if
it is at logical '1' level. It might happen that after a board
reset the logical level '1' is preserved (maybe a level shifter)
forcing the LSM6DSO to enter erroneously in I3C mode, breaking any
attempt to communicate with it. (Fix #38902)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
Armando Visconti 2021-10-06 14:24:56 +02:00 committed by Christopher Friedt
parent 1e1c6151d7
commit a2f3ea5d19

View file

@ -753,6 +753,12 @@ static int lsm6dso_init_chip(const struct device *dev)
return -EIO;
}
/* I3C disable stay preserved after s/w reset */
if (lsm6dso_i3c_disable_set(ctx, LSM6DSO_I3C_DISABLE) < 0) {
LOG_DBG("Failed to disable I3C");
return -EIO;
}
/* reset device */
if (lsm6dso_reset_set(ctx, 1) < 0) {
return -EIO;