diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2014-07-08 12:44:28 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-07-09 03:29:53 +0000 |
commit | 9463fdcb1ade766d620bf7163589b65ecd94d966 (patch) | |
tree | bee75f62e6bc10333e0e9ab2eb7793d92f5f9b6d | |
parent | 27a096870398748861537ff00bc4bdfd05685276 (diff) | |
download | chrome-ec-9463fdcb1ade766d620bf7163589b65ecd94d966.tar.gz |
firefly: add interrupt to detect VBUS transitions quickly
Use the interrupt as faster detection when VBUS is going off, so we are
not missing when the source is cutting its output due to a fault.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=Connect Firefly to Zinger, trigger a short OCP with the electronic
load, once Zinger has recovered from the fault, see Firefly
re-negotiating voltage.
Change-Id: I4d273a0007d1e79884e0acbf75509ab9c8578893
Reviewed-on: https://chromium-review.googlesource.com/207031
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/firefly/board.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/board/firefly/board.c b/board/firefly/board.c index a61069d75b..e5a9277ca7 100644 --- a/board/firefly/board.c +++ b/board/firefly/board.c @@ -60,6 +60,7 @@ void button_event(enum gpio_signal signal) void vbus_event(enum gpio_signal signal) { ccprintf("VBUS! =%d\n", gpio_get_level(signal)); + task_wake(TASK_ID_PD); } void board_config_pre_init(void) @@ -108,6 +109,9 @@ static void board_init(void) gpio_enable_interrupt(GPIO_SW_PP20000); gpio_enable_interrupt(GPIO_SW_PP12000); gpio_enable_interrupt(GPIO_SW_PP5000); + + /* Enable interrupts on VBUS transitions. */ + gpio_enable_interrupt(GPIO_VBUS_WAKE); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); |