diff options
author | Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com> | 2018-06-11 19:41:36 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-06-12 21:50:48 -0700 |
commit | 6476093ceae35ebcdd0fa46232f0a221e2d3dd5a (patch) | |
tree | 06b50518c25e08d02112b4eb1060e814864a37b1 | |
parent | d165b0230060d42919e11477ac65a0d14fd0d6ea (diff) | |
download | chrome-ec-6476093ceae35ebcdd0fa46232f0a221e2d3dd5a.tar.gz |
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 <jagadish.krishnamoorthy@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1096665
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com>
-rw-r--r-- | board/yorp/board.c | 14 |
1 files changed, 14 insertions, 0 deletions
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) |