summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-04-10 09:01:31 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-04-11 01:19:51 -0700
commitfb7817c7352c0a5ff9414679761c22acb1a073f7 (patch)
treeb278c39fdc37601a023a3c5f7f8ac5c3d104ab75
parent74f8a8595d26d55aa85eeb2b1231a85c00e8ce14 (diff)
downloadchrome-ec-fb7817c7352c0a5ff9414679761c22acb1a073f7.tar.gz
poppy: Move PMIC init to a deferred function
Instead of doing I2C traffic in an init hook, move it to a deferred function to be called outside of INIT_HOOK processing. (identical to CL:1001474 on eve branch, moved to poppy board file) BUG=b:77336348 BRANCH=poppy TEST=while true ; do ectool reboot_ec RO ; ectool reboot_ec RW ; done for 24 hours Change-Id: Icd9c2096ca026da6308b74582144886b30ea965f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1003436 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
-rw-r--r--board/poppy/board.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/board/poppy/board.c b/board/poppy/board.c
index 78e5ef584f..ca03776a05 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -528,7 +528,7 @@ static void board_pmic_init(void)
/* Disable power button shutdown timer. */
i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x14, 0x00);
}
-DECLARE_HOOK(HOOK_INIT, board_pmic_init, HOOK_PRIO_DEFAULT);
+DECLARE_DEFERRED(board_pmic_init);
/* Initialize board. */
static void board_init(void)
@@ -605,6 +605,9 @@ static void board_init(void)
/* Enable Gyro interrupts */
gpio_enable_interrupt(GPIO_ACCELGYRO3_INT_L);
+
+ /* Initialize PMIC */
+ hook_call_deferred(&board_pmic_init_data, 0);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);