diff options
author | Diana Z <dzigterman@chromium.org> | 2018-11-08 11:02:22 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-13 16:26:21 -0800 |
commit | b072948de622962e77c03f0a1853432dc6633626 (patch) | |
tree | 604374f7e8e6ed3f1aeca32377488ddec5271f13 /board | |
parent | 40b8b2bc6ffb9103c60f8fe89c9c3eebf899a0e8 (diff) | |
download | chrome-ec-b072948de622962e77c03f0a1853432dc6633626.tar.gz |
SN5S330: treat interrupts as level-sensitive
The SN5S330 PPC will pull its /INT pin low until all interrupts are
cleared. Since the interrupt pin is treated as edge-sensitive, its
handler needs to provide level-checking before exiting. Otherwise, if
not all interrupts are cleared before the handler exits, the EC won't
see another edge to call the handler again.
Boards which share the PPC interrupt pin with other sources may choose
to implement their own callback, if they are able to determine which
chip was the source of the interrupt.
BUG=b:118846062
BRANCH=None
TEST=performed several power swaps and unplugs on a pair of Careenas,
verifying that in instances where the handler had to loop around we
correctly cleared the interrupts and the "ectool usbpdpower" output was
normal
Change-Id: Iccbe40976a746d109d67b9a91f8fbd81898f9b3f
Signed-off-by: Diana Z <dzigterman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1327123
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/ampton/board.c | 8 | ||||
-rw-r--r-- | board/bip/board.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/board/ampton/board.c b/board/ampton/board.c index 63e124fa79..9282df416f 100644 --- a/board/ampton/board.c +++ b/board/ampton/board.c @@ -49,6 +49,14 @@ static void ppc_interrupt(enum gpio_signal signal) sn5s330_interrupt(1); } +int ppc_get_alert_status(int port) +{ + if (port == 0) + return gpio_get_level(GPIO_USB_C0_PD_INT_ODL) == 0; + else + return gpio_get_level(GPIO_USB_C1_PD_INT_ODL) == 0; +} + #include "gpio_list.h" /* Must come after other header files. */ /******************************************************************************/ diff --git a/board/bip/board.c b/board/bip/board.c index f82d0c41d9..318a5bc178 100644 --- a/board/bip/board.c +++ b/board/bip/board.c @@ -42,6 +42,14 @@ static void ppc_interrupt(enum gpio_signal signal) sn5s330_interrupt(1); } +int ppc_get_alert_status(int port) +{ + if (port == 0) + return gpio_get_level(GPIO_USB_C0_PD_INT_ODL) == 0; + else + return gpio_get_level(GPIO_USB_C1_PD_INT_ODL) == 0; +} + #include "gpio_list.h" /* Must come after other header files. */ /******************************************************************************/ |