summaryrefslogtreecommitdiff
path: root/chip/mec1322/system.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-02-17 10:15:56 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-02-17 15:33:07 -0800
commitc505edb0b5f3ed329338047127f356733ab72184 (patch)
tree319acb94c31dc62c2c9bfb0ea2134fc4784933c4 /chip/mec1322/system.c
parentebe37f0008af291a1a536ae9012cc370498fb818 (diff)
downloadchrome-ec-c505edb0b5f3ed329338047127f356733ab72184.tar.gz
hibernate: Inform PD MCU before calling board hibernate callback
board_hibernate() may take alternate actions to place the chip into hibernate, so inform the PD MCU that we're going to hibernate before calling the function. BUG=None TEST=Run 'hibernate' on chell, verify that PD MCU goes to hibernate and wakes when AC is attached. BRANCH=glados Change-Id: I71c12dcb416d54c79ac7d40e9bf430e268071fb2 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/327613 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/mec1322/system.c')
-rw-r--r--chip/mec1322/system.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c
index f7fa770388..c199332f57 100644
--- a/chip/mec1322/system.c
+++ b/chip/mec1322/system.c
@@ -190,9 +190,6 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds)
{
int i;
- if (board_hibernate)
- board_hibernate();
-
#ifdef CONFIG_HOSTCMD_PD
/* Inform the PD MCU that we are going to hibernate. */
host_command_pd_request_hibernate();
@@ -202,6 +199,9 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds)
cflush();
+ if (board_hibernate)
+ board_hibernate();
+
/* Disable interrupts */
interrupt_disable();
for (i = 0; i <= 92; ++i) {