summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2021-06-22 15:20:54 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-23 19:50:50 +0000
commit34c5ffd676aba1c65e857d5312d9dc7602c557f4 (patch)
tree8cbf3f44b2394e93093e6acc57343dc285066de7
parentc53279eb78e62136c372d439155a7f4e62c4dbd2 (diff)
downloadchrome-ec-34c5ffd676aba1c65e857d5312d9dc7602c557f4.tar.gz
trogdor: Separate the board_hibernate() to a separate file
Move the board_hiberante() from board.c to a separate file hibernate.c. This makes Zephyr easier to include the code. BRANCH=None BUG=b:191803008 TEST=Built the trogdor image successfully. Change-Id: Ie3749b9db72fc5b0535cfb6f9ef92499b3b46b82 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980447 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--board/trogdor/board.c12
-rw-r--r--board/trogdor/build.mk1
-rw-r--r--board/trogdor/hibernate.c18
3 files changed, 19 insertions, 12 deletions
diff --git a/board/trogdor/board.c b/board/trogdor/board.c
index 470f117a14..0d7eccdc57 100644
--- a/board/trogdor/board.c
+++ b/board/trogdor/board.c
@@ -122,18 +122,6 @@ static void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
-void board_hibernate(void)
-{
- /*
- * Sensors are unpowered in hibernate. Apply PD to the
- * interrupt lines such that they don't float.
- */
- gpio_set_flags(GPIO_ACCEL_GYRO_INT_L,
- GPIO_INPUT | GPIO_PULL_DOWN);
- gpio_set_flags(GPIO_LID_ACCEL_INT_L,
- GPIO_INPUT | GPIO_PULL_DOWN);
-}
-
/* Called on AP S0 -> S3 transition */
static void board_chipset_suspend(void)
{
diff --git a/board/trogdor/build.mk b/board/trogdor/build.mk
index 0d71877c98..7fe4452669 100644
--- a/board/trogdor/build.mk
+++ b/board/trogdor/build.mk
@@ -13,6 +13,7 @@ BASEBOARD:=trogdor
board-y+=battery.o
board-y+=board.o
+board-y+=hibernate.o
board-y+=led.o
board-y+=switchcap.o
board-y+=usbc_config.o
diff --git a/board/trogdor/hibernate.c b/board/trogdor/hibernate.c
new file mode 100644
index 0000000000..504a295463
--- /dev/null
+++ b/board/trogdor/hibernate.c
@@ -0,0 +1,18 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gpio.h"
+
+void board_hibernate(void)
+{
+ /*
+ * Sensors are unpowered in hibernate. Apply PD to the
+ * interrupt lines such that they don't float.
+ */
+ gpio_set_flags(GPIO_ACCEL_GYRO_INT_L,
+ GPIO_INPUT | GPIO_PULL_DOWN);
+ gpio_set_flags(GPIO_LID_ACCEL_INT_L,
+ GPIO_INPUT | GPIO_PULL_DOWN);
+}