From 1f05c52d4e434fde0de9ccbfe5e7f418abec7c4f Mon Sep 17 00:00:00 2001 From: Wai-Hong Tam Date: Mon, 28 Jun 2021 10:26:23 -0700 Subject: herobrine: Move hibernate config to the board level Move the config of hibernate wake source and hook from the baseboard level to the board level. The new Herobrine hardware will use different wake sources and have different hook. BRANCH=None BUG=b:192253134 TEST=Built the herobrine_npcx7 EC-OS and Zephyr images successfully. Change-Id: Idbad8f985252fdef0657427d5f8d5883029a641f Signed-off-by: Wai-Hong Tam Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2993211 Reviewed-by: Keith Short --- board/herobrine_npcx7/board.c | 9 +++++++++ board/herobrine_npcx7/hibernate.c | 6 ++++++ 2 files changed, 15 insertions(+) (limited to 'board/herobrine_npcx7') diff --git a/board/herobrine_npcx7/board.c b/board/herobrine_npcx7/board.c index 19fe8e0226..2ad97b43a5 100644 --- a/board/herobrine_npcx7/board.c +++ b/board/herobrine_npcx7/board.c @@ -31,6 +31,15 @@ #include "gpio_list.h" +/* Wake-up pins for hibernate */ +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_LID_OPEN, + GPIO_AC_PRESENT, + GPIO_POWER_BUTTON_L, + GPIO_EC_RST_ODL, +}; +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + /* Keyboard scan setting */ struct keyboard_scan_config keyscan_config = { /* Use 80 us, because KSO_02 passes through the H1. */ diff --git a/board/herobrine_npcx7/hibernate.c b/board/herobrine_npcx7/hibernate.c index 504a295463..f6ebf462aa 100644 --- a/board/herobrine_npcx7/hibernate.c +++ b/board/herobrine_npcx7/hibernate.c @@ -5,6 +5,12 @@ #include "gpio.h" +void board_hibernate_late(void) +{ + /* Set the hibernate GPIO to turn off the rails */ + gpio_set_level(GPIO_HIBERNATE_L, 0); +} + void board_hibernate(void) { /* -- cgit v1.2.1