diff options
author | Diana Z <dzigterman@chromium.org> | 2020-07-08 09:11:30 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-09 08:11:41 +0000 |
commit | 8ed00258022b8a3ecff4181445f35ba74c672c65 (patch) | |
tree | 16679061377c5b8c1c2579cdbe94b15de05f3112 /board/waddledee | |
parent | 51c7bd33d57572b638721479c505baedcae19406 (diff) | |
download | chrome-ec-8ed00258022b8a3ecff4181445f35ba74c672c65.tar.gz |
Waddledee: Check interrupt lines during init
The interrupt line for the charger may already be low before inits have
completed. If this is the case, set up a deferred call to clear the
interrupts from the chips during the first run of the hooks task.
BRANCH=None
BUG=b:160618359
TEST=on waddledee, observe that when the EC reboots with the C0
interrupt line low the interrupts are processed and PD negotiation can
succeed
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Iba1b76e0b6502e1628648e08524bbc7ec1c0437b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2287550
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/waddledee')
-rw-r--r-- | board/waddledee/board.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/board/waddledee/board.c b/board/waddledee/board.c index d87f8cfddc..ddf23ef917 100644 --- a/board/waddledee/board.c +++ b/board/waddledee/board.c @@ -210,6 +210,16 @@ void board_init(void) gpio_enable_interrupt(GPIO_USB_C0_INT_ODL); gpio_enable_interrupt(c1_int_line); + + /* + * If interrupt lines are already low, schedule them to be processed + * after inits are completed. + */ + if (!gpio_get_level(GPIO_USB_C0_INT_ODL)) + hook_call_deferred(&check_c0_line_data, 0); + if (!gpio_get_level(c1_int_line)) + hook_call_deferred(&check_c1_line_data, 0); + gpio_enable_interrupt(GPIO_USB_C0_CCSBU_OVP_ODL); /* Enable Base Accel interrupt */ gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L); |