summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McRae <amcrae@google.com>2022-01-18 15:46:46 +1100
committerCommit Bot <commit-bot@chromium.org>2022-01-18 10:31:22 +0000
commit8782efb66323346b0dceb0b558162132a3f282f2 (patch)
tree41d9e69d70b79c8d13c28df1cce0a97dac29202d
parentdda3b165fe07f9a2f24f624be7b421bd2b0db7bd (diff)
downloadchrome-ec-8782efb66323346b0dceb0b558162132a3f282f2.tar.gz
nissa: Add board hibernate function
Add board hibernate function. Hibernate the chargers, and then activate the GPIO to hibernate the EC. Will be woken up by any of the configured wake pins. BUG=b:214478293 TEST=enter 'hibernate' cmd, confirm power off, press power, wakes up. BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: If42dfc8279bc0d4ceb7aaa4701a2acc046350299 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3397149 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
-rw-r--r--zephyr/projects/nissa/src/usbc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/zephyr/projects/nissa/src/usbc.c b/zephyr/projects/nissa/src/usbc.c
index 7f4f413dc8..71150894fa 100644
--- a/zephyr/projects/nissa/src/usbc.c
+++ b/zephyr/projects/nissa/src/usbc.c
@@ -7,6 +7,8 @@
#include "chipset.h"
#include "hooks.h"
#include "usb_mux.h"
+#include "system.h"
+#include "driver/charger/isl923x_public.h"
#include "driver/tcpm/tcpci.h"
#include "driver/tcpm/raa489000.h"
@@ -51,6 +53,22 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
},
};
+/*
+ * Board specific hibernate function.
+ */
+__override void board_hibernate_late(void)
+{
+ raa489000_hibernate(CHARGER_PRIMARY, true);
+ if (board_get_usb_pd_port_count() == 2)
+ raa489000_hibernate(CHARGER_SECONDARY, true);
+
+ gpio_set_level(GPIO_EN_SLP_Z, 1);
+ /*
+ * The system should hibernate, but there may be
+ * a small delay, so return.
+ */
+}
+
static uint8_t cached_usb_pd_port_count;
__override uint8_t board_get_usb_pd_port_count(void)