diff options
author | Anton Staaf <robotboy@chromium.org> | 2016-03-02 13:42:18 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-03-21 13:16:35 -0700 |
commit | fa1653d240e7635b1cbf03e1e786f16a4ea7e95f (patch) | |
tree | 4d41752eb464f4a254ecc5095d2adfa4bc93da9c /chip | |
parent | 952b2a54e12bfbf6635a5eb225ad777814ca9c92 (diff) | |
download | chrome-ec-fa1653d240e7635b1cbf03e1e786f16a4ea7e95f.tar.gz |
GPIO: Rename and move board_set_gpio_hibernate_state
This function is no longer GPIO specific and fits better as part of the
system API, so this moves it there and renames it board_hibernate_late.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Change-Id: I39d3ecedadaaa22142cc82c79f5d25c891f3f38c
Reviewed-on: https://chromium-review.googlesource.com/330124
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/mec1322/system.c | 4 | ||||
-rw-r--r-- | chip/npcx/system.c | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c index c199332f57..0090c6b862 100644 --- a/chip/mec1322/system.c +++ b/chip/mec1322/system.c @@ -253,8 +253,8 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) CPU_SCB_SYSCTRL |= 0x4; /* Setup GPIOs for hibernate */ - if (board_set_gpio_hibernate_state) - board_set_gpio_hibernate_state(); + if (board_hibernate_late) + board_hibernate_late(); #ifdef CONFIG_USB_PD_PORT_COUNT /* diff --git a/chip/npcx/system.c b/chip/npcx/system.c index dd4ca3dbed..270531226a 100644 --- a/chip/npcx/system.c +++ b/chip/npcx/system.c @@ -315,10 +315,6 @@ void system_set_gpios_and_wakeup_inputs_hibernate(void) /* Enable wake-up inputs of hibernate_wake_pins array */ for (i = 0; i < hibernate_wake_pins_used; i++) gpio_reset(hibernate_wake_pins[i]); - - /* board-level function to set GPIOs state in hibernate */ - if (board_set_gpio_hibernate_state) - board_set_gpio_hibernate_state(); } /** @@ -383,6 +379,13 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds) */ system_set_gpios_and_wakeup_inputs_hibernate(); + /* + * Give the board a chance to do any late stage hibernation work. + * This is likely going to configure GPIOs for hibernation. + */ + if (board_hibernate_late) + board_hibernate_late(); + /* Clear all pending IRQ otherwise wfi will have no affect */ for (i = NPCX_IRQ_0 ; i < NPCX_IRQ_COUNT ; i++) task_clear_pending_irq(i); |