summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-01-27 16:12:43 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-28 22:54:54 -0800
commit88e64e11e19be5284ce77fb1afab1dae48970a50 (patch)
tree821eefa5dc262018fd31ebcaba639405ed97695a
parent9148a4dc0188a92e239521feae12871ff8bd9626 (diff)
downloadchrome-ec-88e64e11e19be5284ce77fb1afab1dae48970a50.tar.gz
chell: Trigger PMIC shutdown rather than hibernate
Shut down all PMIC-supplied power rails rather than initiating EC / PD hibernate. This results in considerable power savings. BUG=chrome-os-partner:48835 BRANCH=glados TEST=Manual on chell. Run "hibernate" on EC console, verify that 3.3V EC DSW rail goes to 0V, and the EC powers up on zinger insert, lid open or power button press. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I7bf0c494ea240183240f5a6abc3d611df8efb45a Reviewed-on: https://chromium-review.googlesource.com/324087 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/chell/board.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/board/chell/board.c b/board/chell/board.c
index b05926bb50..759521eeb9 100644
--- a/board/chell/board.c
+++ b/board/chell/board.c
@@ -369,17 +369,25 @@ static void board_chipset_suspend(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
-void board_set_gpio_hibernate_state(void)
+void board_hibernate(void)
{
- /* Turn off LEDs in hibernate */
- gpio_set_level(GPIO_CHARGE_LED_1, 0);
- gpio_set_level(GPIO_CHARGE_LED_2, 0);
+ CPRINTS("Triggering PMIC shutdown.");
+ uart_flush_output();
+
+ /* Trigger PMIC shutdown. */
+ if (i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x49, 0x01)) {
+ /*
+ * If we can't tell the PMIC to shutdown, instead reset
+ * and don't start the AP. Hopefully we'll be able to
+ * communicate with the PMIC next time.
+ */
+ CPRINTS("PMIC i2c failed.");
+ system_reset(SYSTEM_RESET_LEAVE_AP_OFF);
+ }
- /*
- * Set PD wake low so that it toggles high to generate a wake
- * event once we leave hibernate.
- */
- gpio_set_level(GPIO_USB_PD_WAKE, 0);
+ /* Await shutdown. */
+ while (1)
+ ;
}
/* Make the pmic re-sequence the power rails under these conditions. */