glados: Turn off LEDs in hibernate

Use new board-level hibernate GPIO state function to turn off LEDs in
hibernate.

BUG=chrome-os-partner:43807
TEST=Manual on Glados with subsequent commit. Run 'hibernate' on console,
verify that LED remains off. Press power button, verify that board wakes.
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Id695df9b5e75514f8f807a894b63f71676b66f92
Reviewed-on: https://chromium-review.googlesource.com/292317
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Shawn Nematbakhsh
2015-08-10 15:42:12 -07:00
committed by ChromeOS Commit Bot
parent 5b93f04c19
commit ccb0c13931
2 changed files with 30 additions and 8 deletions

View File

@@ -319,3 +319,33 @@ void board_chipset_suspend(void)
gpio_set_level(GPIO_PP1800_DX_SENSOR_EN, 0);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
/* Turn off LEDs in hibernate */
uint32_t board_get_gpio_hibernate_state(uint32_t port, uint32_t pin)
{
int i;
const uint32_t led_gpios[][2] = {
GPIO_TO_PORT_MASK_PAIR(GPIO_CHARGE_LED_1),
GPIO_TO_PORT_MASK_PAIR(GPIO_CHARGE_LED_2),
};
#ifdef GLADOS_BOARD_V1
/*
* Leave PCH RTCRST deasserted.
* TODO(crosbug.com/p/42774): Remove this once we have a
* pull-down on PCH_RTCRST.
*/
const uint32_t rtcrst_gpio[2] =
GPIO_TO_PORT_MASK_PAIR(GPIO_PCH_RTCRST);
if (port == rtcrst_gpio[0] && pin == rtcrst_gpio[1])
return GPIO_OUTPUT | GPIO_LOW;
#endif
/* LED GPIOs should be driven low to turn off LEDs */
for (i = 0; i < ARRAY_SIZE(led_gpios); ++i)
if (led_gpios[i][0] == port && led_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;
}

View File

@@ -187,14 +187,6 @@ static uint32_t system_get_gpio_hibernate_state(uint32_t port, uint32_t pin)
{
int i;
const int skip[][2] = {
#ifdef GLADOS_BOARD_V1
/*
* Leave PCH RTCRST deasserted.
* TODO(crosbug.com/p/42774): Remove this once we have a
* pull-down on PCH_RTCRST.
*/
GPIO_TO_PORT_MASK_PAIR(GPIO_PCH_RTCRST),
#endif
/*
* Leave USB-C charging enabled in hibernate, in order to
* allow wake-on-plug. 5V enable must be pulled low.