summaryrefslogtreecommitdiff
path: root/board/cheza/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/cheza/board.c')
-rw-r--r--board/cheza/board.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/board/cheza/board.c b/board/cheza/board.c
index 8570349f77..d533f296c3 100644
--- a/board/cheza/board.c
+++ b/board/cheza/board.c
@@ -395,6 +395,7 @@ void board_tcpc_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C+1);
+/* Called on AP S0 -> S3 transition */
static void board_chipset_suspend(void)
{
/*
@@ -405,6 +406,7 @@ static void board_chipset_suspend(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
+/* Called on AP S3 -> S0 transition */
static void board_chipset_resume(void)
{
/* Turn on display backlight in S0. */
@@ -412,6 +414,21 @@ static void board_chipset_resume(void)
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
+/* Called on AP S5 -> S3 transition */
+static void board_chipset_startup(void)
+{
+ gpio_set_flags(GPIO_USB_C1_OC_ODL, GPIO_INPUT | GPIO_PULL_UP);
+}
+DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT);
+
+/* Called on AP S3 -> S5 transition */
+static void board_chipset_shutdown(void)
+{
+ /* 5V is off in S5. Disable pull-up to prevent current leak. */
+ gpio_set_flags(GPIO_USB_C1_OC_ODL, GPIO_INPUT);
+}
+DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT);
+
/**
* Power on (or off) a single TCPC.
* minimum on/off delays are included.