summaryrefslogtreecommitdiff
path: root/board/yorp/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/yorp/board.c')
-rw-r--r--board/yorp/board.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/board/yorp/board.c b/board/yorp/board.c
index 1b2dccf4b1..0cfeccbd2e 100644
--- a/board/yorp/board.c
+++ b/board/yorp/board.c
@@ -240,3 +240,13 @@ static void post_old_board_warning(void)
}
DECLARE_HOOK(HOOK_INIT, post_old_board_warning, HOOK_PRIO_INIT_I2C + 1);
#endif
+
+void board_overcurrent_event(int port, int is_overcurrented)
+{
+ /* Sanity check the port. */
+ if ((port < 0) || (port >= CONFIG_USB_PD_PORT_COUNT))
+ return;
+
+ /* Note that the level is inverted because the pin is active low. */
+ gpio_set_level(GPIO_USB_C_OC, !is_overcurrented);
+}