diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-05-22 15:07:21 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-23 04:50:22 +0000 |
commit | 3dff34e653ff407b111ea9356e67af7edc02d3f2 (patch) | |
tree | 76feea036b045dd17f3fd5aceaf34815ec5a4337 /board/samus_pd/board.c | |
parent | 113ea43a6986404132ce782288ee4ccb95ffe17d (diff) | |
download | chrome-ec-3dff34e653ff407b111ea9356e67af7edc02d3f2.tar.gz |
samus_pd: add interrupt to detect VBUS transitions quickly
Add interrupt to VBUS signal to detect VBUS transitions
quickly to make sure we transition out of SNK_READY when VBUS
goes away.
BUG=chrome-os-partner:28611
BRANCH=none
TEST=Test on samus 1.9 board. Ran for hours with charger plugged
in, made sure when charger cuts out after missing ping responses,
that it successfully goes to disconnected state and renogiates
power.
Change-Id: I93b2e49891e6a38c98095b7311a9435606cc61ab
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/201155
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/samus_pd/board.c')
-rw-r--r-- | board/samus_pd/board.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index 561563a6e5..9105c9322e 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -18,7 +18,8 @@ void vbus_evt(enum gpio_signal signal) { - ccprintf("VBUS %d!\n", signal); + ccprintf("VBUS %d, %d!\n", signal, gpio_get_level(signal)); + task_wake(TASK_ID_PD); } void bc12_evt(enum gpio_signal signal) @@ -176,6 +177,9 @@ static void board_init(void) * to specify device mode. */ gpio_set_level(GPIO_USB_C_CC_EN, 1); + + /* Enable interrupts on VBUS transitions. */ + gpio_enable_interrupt(GPIO_USB_C0_VBUS_WAKE); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); |