summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/chell/board.c38
-rw-r--r--board/glados/board.c34
-rw-r--r--board/wheatley/board.c2
3 files changed, 21 insertions, 53 deletions
diff --git a/board/chell/board.c b/board/chell/board.c
index 27316719e0..b0e4ec2ac5 100644
--- a/board/chell/board.c
+++ b/board/chell/board.c
@@ -357,35 +357,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 reset PMIC is active high */
- GPIO_TO_PORT_MASK_PAIR(GPIO_PMIC_LDO_EN),
- /* The GPIO to control RTCRST is active high. */
- GPIO_TO_PORT_MASK_PAIR(GPIO_PCH_RTCRST),
- /* Keep keyboard backlight off, GPIO34 pin is in PWM mode */
- GPIO_TO_PORT_MASK_PAIR(GPIO_KEYBOARD_BACKLIGHT),
- /* RSMRST to PCH should be low when rails are off */
- GPIO_TO_PORT_MASK_PAIR(GPIO_PCH_RSMRST_L),
- };
-
- /* Some GPIOs should be driven low in hibernate */
- 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);
}
/* Make the pmic re-sequence the power rails under these conditions. */
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. */
diff --git a/board/wheatley/board.c b/board/wheatley/board.c
index 143642c3e0..8fcd142efa 100644
--- a/board/wheatley/board.c
+++ b/board/wheatley/board.c
@@ -379,7 +379,7 @@ static void board_chipset_suspend(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
-void board_set_gpio_state_hibernate(void)
+void board_set_gpio_hibernate_state(void)
{
int i;
const uint32_t hibernate_pins[][2] = {