summaryrefslogtreecommitdiff
path: root/board/glados
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-01-21 14:37:53 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-25 19:48:21 -0800
commit8c9210b81e83c94d9d34497d202476c4fa6fb34b (patch)
tree62736db763a94b69d81a4cd2a6f814fe72ba28ac /board/glados
parentf5e9dbe10688cea2d5426c96e3a8976efb22a8a7 (diff)
downloadchrome-ec-8c9210b81e83c94d9d34497d202476c4fa6fb34b.tar.gz
mec1322: hibernate: Don't reconfigure all GPIOs
Configuring all GPIOs to INPUT / PULL_UP in hibernate is not a good idea: - INPUT / PULL_UP is not necessarially the lowest-power state (for example, if there is an onboard pull-down). - Most GPIOs should already be in lowest-power state when we're in S5. - For the few GPIOs that need to be in a different state for hibernate, we can use a board-level callback. In addition, remove mec1322 code related to restoring from hibernate state, since we always reset coming out of hibernate. BUG=chrome-os-partner:49608 BRANCH=glados, strago TEST=`hibernate` on chell console when in S5 and AC removed. Verify that EC power is roughly equivalent to low-power idle power. Attach Zinger, verify that device wakes and boots, and charges from charger. Change-Id: Ib00ef035bec32cea3847eb38d743f5c0cec896ca Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/322937 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'board/glados')
-rw-r--r--board/glados/board.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/board/glados/board.c b/board/glados/board.c
index 534a8086aa..eb39af9f4e 100644
--- a/board/glados/board.c
+++ b/board/glados/board.c
@@ -419,31 +419,17 @@ static void board_chipset_suspend(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
-uint32_t board_get_gpio_hibernate_state(uint32_t port, uint32_t pin)
+void board_set_gpio_hibernate_state(void)
{
- int i;
- const uint32_t out_low_gpios[][2] = {
- /* Turn off LEDs in hibernate */
- GPIO_TO_PORT_MASK_PAIR(GPIO_CHARGE_LED_1),
- GPIO_TO_PORT_MASK_PAIR(GPIO_CHARGE_LED_2),
- /*
- * Set PD wake low so that it toggles high to generate a wake
- * event once we leave hibernate.
- */
- GPIO_TO_PORT_MASK_PAIR(GPIO_USB_PD_WAKE),
- /* The GPIO to control RTCRST is active high. */
- GPIO_TO_PORT_MASK_PAIR(GPIO_PCH_RTCRST),
- /* RSMRST to PCH should be low when rails are off */
- GPIO_TO_PORT_MASK_PAIR(GPIO_PCH_RSMRST_L),
- };
-
- /* LED GPIOs should be driven low to turn off LEDs */
- for (i = 0; i < ARRAY_SIZE(out_low_gpios); ++i)
- if (out_low_gpios[i][0] == port && out_low_gpios[i][1] == pin)
- return GPIO_OUTPUT | GPIO_LOW;
-
- /* Other GPIOs should be put in a low-power state */
- return GPIO_INPUT | GPIO_PULL_UP;
+ /* Turn off LEDs in hibernate */
+ gpio_set_level(GPIO_CHARGE_LED_1, 0);
+ gpio_set_level(GPIO_CHARGE_LED_2, 0);
+
+ /*
+ * 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);
}
/* Any glados boards post version 2 should have ROP_LDO_EN stuffed. */