Skip to content

Commit

Permalink
drivers/sensor: lsm6dso: Prevent device entering I3C
Browse files Browse the repository at this point in the history
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 zephyrproject-rtos#38902)

Signed-off-by: Armando Visconti <[email protected]>
  • Loading branch information
avisconti authored and cfriedt committed Oct 7, 2021
1 parent 1e1c615 commit a2f3ea5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/sensor/lsm6dso/lsm6dso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a2f3ea5

Please sign in to comment.