summaryrefslogtreecommitdiff
path: root/zephyr/projects/corsola/src/hibernate.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/projects/corsola/src/hibernate.c')
-rw-r--r--zephyr/projects/corsola/src/hibernate.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/zephyr/projects/corsola/src/hibernate.c b/zephyr/projects/corsola/src/hibernate.c
new file mode 100644
index 0000000000..56c085e077
--- /dev/null
+++ b/zephyr/projects/corsola/src/hibernate.c
@@ -0,0 +1,22 @@
+/* Copyright 2021 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#include <zephyr/drivers/gpio.h>
+
+#include "charger.h"
+#include "driver/charger/isl923x_public.h"
+#include "system.h"
+
+/* Corsola board specific hibernate implementation */
+__override void board_hibernate(void)
+{
+#ifdef CONFIG_CHARGER_ISL9238C
+ isl9238c_hibernate(CHARGER_SOLO);
+#endif
+}
+
+__override void board_hibernate_late(void)
+{
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_ulp), 1);
+}