From 3d3f2316b7d2f060d4f8c919a2c82326f8651af3 Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Tue, 16 Mar 2021 13:32:32 +0800 Subject: 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 Change-Id: I3a502c182bb766b52dd5d85014478f9c0014360a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2763605 Reviewed-by: Ting Shen --- board/burnet/board.c | 7 +++---- 1 file 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; } -- cgit v1.2.1