From 6476093ceae35ebcdd0fa46232f0a221e2d3dd5a Mon Sep 17 00:00:00 2001 From: Jagadish Krishnamoorthy Date: Mon, 11 Jun 2018 19:41:36 -0700 Subject: [PATCH] yorp: implement late hibernate call Implement board_hibernate_late function to turn off the LED's. BUG=b:110057984 BRANCH=NONE TEST=On Yorp board, enter hibernate mode through key combination "Alt H Vol Up" , observe that LED is turned off. Change-Id: Idb412cbbbb549c54b449cd4571226e284dd88e6a Signed-off-by: Jagadish Krishnamoorthy Reviewed-on: https://chromium-review.googlesource.com/1096665 Reviewed-by: Jett Rink Reviewed-by: Vijay Hiremath --- board/yorp/board.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/board/yorp/board.c b/board/yorp/board.c index c94f338024..db72cbe744 100644 --- a/board/yorp/board.c +++ b/board/yorp/board.c @@ -289,6 +289,20 @@ static void board_init(void) } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); +void board_hibernate_late(void) { + + int i; + + const uint32_t hibernate_pins[][2] = { + /* Turn off LEDs before going to hibernate */ + {GPIO_BAT_LED_BLUE_L, GPIO_INPUT | GPIO_PULL_UP}, + {GPIO_BAT_LED_ORANGE_L, GPIO_INPUT | GPIO_PULL_UP}, + }; + + for (i = 0; i < ARRAY_SIZE(hibernate_pins); ++i) + gpio_set_flags(hibernate_pins[i][0], hibernate_pins[i][1]); +} + #ifndef TEST_BUILD /* This callback disables keyboard when convertibles are fully open */ void lid_angle_peripheral_enable(int enable)