diff options
author | Ben Chen <ben.chen2@quanta.corp-partner.google.com> | 2021-02-03 08:16:43 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-04 06:08:55 +0000 |
commit | d78e31576248a3f496a3ff92c44c4806111933e4 (patch) | |
tree | 3a6fd3eca09f86d845420f950ee0e106c84feaf2 /board/kindred | |
parent | feeb2c29df487ef3e59ff6440090d9d2da56d7a8 (diff) | |
download | chrome-ec-d78e31576248a3f496a3ff92c44c4806111933e4.tar.gz |
kindred: Add detect accel/gyro sensor in HOOK_INIT
Add detect accel/gyro sensor in HOOK_INIT for sysjump rw.
Use "HOOK_PRIO_INIT_ADC + 2" For sku_id checking.
And make sure detect sensor when chipset power on.
BUG=b:175918382
BRANCH=hatch
TEST=sysjump ro/rw to check motionsense data.
Change-Id: Ib5de2225b0534d91bda4127a8a22a23cdbea59ae
Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2669748
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'board/kindred')
-rw-r--r-- | board/kindred/board.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/board/kindred/board.c b/board/kindred/board.c index 936b192683..18f8011f1f 100644 --- a/board/kindred/board.c +++ b/board/kindred/board.c @@ -546,7 +546,10 @@ static void determine_accel_devices(void) { static uint8_t read_time; - if (read_time == 0) { + if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) + return; + + if (read_time == 0 && board_is_convertible()) { /* Read g sensor chip id*/ i2c_read8(I2C_PORT_ACCEL, KX022_ADDR0_FLAGS, KX022_WHOAMI, &lid_device_id); @@ -575,6 +578,7 @@ static void determine_accel_devices(void) } } DECLARE_HOOK(HOOK_CHIPSET_RESUME, determine_accel_devices, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, determine_accel_devices, HOOK_PRIO_INIT_ADC + 2); void motion_interrupt(enum gpio_signal signal) { |