summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2021-03-16 13:32:32 +0800
committerCommit Bot <commit-bot@chromium.org>2021-03-18 10:42:12 +0000
commit3d3f2316b7d2f060d4f8c919a2c82326f8651af3 (patch)
tree0589e8bb3796035efdcd1cf1255703aecbcb1e34
parentc200669dfe250a989864e7889f3e2f35406ec40d (diff)
downloadchrome-ec-3d3f2316b7d2f060d4f8c919a2c82326f8651af3.tar.gz
burnet: Change detect method for 2nd base accel
Both bmi160 and icm-40608 are using spi interface with Jacuzzi. The sensor will acknowledge with the ping. we should make sure the return value is matching the chip content. BUG=b:173647487 BRANCH=firmware-kukui-12573.B TEST=ectool motionsense on both bmi160 and icm-40608 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I3a502c182bb766b52dd5d85014478f9c0014360a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2763605 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--board/burnet/board.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/board/burnet/board.c b/board/burnet/board.c
index 4d1ae6e754..8bc435a44a 100644
--- a/board/burnet/board.c
+++ b/board/burnet/board.c
@@ -498,11 +498,10 @@ static void board_update_config(void)
if (rv == EC_SUCCESS)
motion_sensors[LID_ACCEL] = lid_accel_kx022;
- /* Ping for ack */
- rv = icm_read8(&base_accel_icm426xx,
- ICM426XX_REG_WHO_AM_I, &val);
+ /* Read icm-40608 chip content */
+ icm_read8(&base_accel_icm426xx, ICM426XX_REG_WHO_AM_I, &val);
- if (rv == EC_SUCCESS) {
+ if (rv == EC_SUCCESS && val == ICM426XX_CHIP_ICM40608) {
motion_sensors[BASE_ACCEL] = base_accel_icm426xx;
motion_sensors[BASE_GYRO] = base_gyro_icm426xx;
}