diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2020-07-16 10:21:18 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-17 13:57:24 +0000 |
commit | 7fae3ff59d0aadaefee12a300b0af29973969ba5 (patch) | |
tree | 94ab265cc0bf9e760db37835c94058cfa59ec1f7 /board/drawcia | |
parent | 05215cb07ddf1d7c1ad2dc22ce3f7f01b6645763 (diff) | |
download | chrome-ec-7fae3ff59d0aadaefee12a300b0af29973969ba5.tar.gz |
drawcia: Check interrupt lines during init
This patch land https://crrev.com/c/2287550 to drawcia.
BUG=none
BRANCH=none
TEST=Verify C0/C1 port works.
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: Ie2d74b1dd17467e0a96694b5ac4cfd3ae01d2ef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2299608
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/drawcia')
-rw-r--r-- | board/drawcia/board.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c index 1827c7c6ac..7493f3737f 100644 --- a/board/drawcia/board.c +++ b/board/drawcia/board.c @@ -250,8 +250,6 @@ void board_init(void) { int on; - gpio_enable_interrupt(GPIO_USB_C0_INT_ODL); - if (get_cbi_fw_config_db() == DB_1A_HDMI) { /* Select HDMI option */ gpio_set_level(GPIO_HDMI_SEL_L, 0); @@ -260,7 +258,19 @@ void board_init(void) gpio_set_level(GPIO_HDMI_SEL_L, 1); } + gpio_enable_interrupt(GPIO_USB_C0_INT_ODL); gpio_enable_interrupt(GPIO_USB_C1_INT_ODL); + + + /* + * 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(GPIO_USB_C1_INT_ODL)) + 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); |