From 4aa42ad1f88afacf5b5d392f8ec96b03a9716c95 Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Tue, 16 Mar 2021 13:32:32 +0800 Subject: Reland "burnet: Change detect method for 2nd base accel" This is a reland of 3d3f2316b7d2f060d4f8c919a2c82326f8651af3 Original change's description: > 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 Bug: b:173647487 Change-Id: I140aeacd46d74216bc7c999c493dc1be1590aa5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2783510 Reviewed-by: Ting Shen Commit-Queue: Devin Lu Tested-by: Devin Lu --- board/burnet/board.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'board/burnet') diff --git a/board/burnet/board.c b/board/burnet/board.c index 31eaa7af8e..a4bf2cd59e 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 */ + rv = 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