From 0539cc2ed5692fd17a120ba6eed8c5ece67be82b Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 20 Aug 2014 15:39:49 -0500 Subject: ryu: detect recovery mode and set proper event When the power button, volume up, and volume down buttons are pressed during boot indicate to the AP that recovery mode is enabled. BUG=chrome-os-partner:31481 BRANCH=None TEST=Benson tested this w/ his magic cables. Change-Id: I2f285d6b8b71708eff53e8b46020e51c96f281a4 Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/213299 Reviewed-by: Alec Berg --- board/ryu/board.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/board/ryu/board.c b/board/ryu/board.c index a7ccd8c8da..64b338866b 100644 --- a/board/ryu/board.c +++ b/board/ryu/board.c @@ -12,6 +12,7 @@ #include "console.h" #include "gpio.h" #include "hooks.h" +#include "host_command.h" #include "i2c.h" #include "power.h" #include "power_button.h" @@ -37,6 +38,15 @@ void unhandled_evt(enum gpio_signal signal) /* Initialize board. */ static void board_init(void) { + /* + * Determine recovery mode is requested by the power, volup, and + * voldown buttons being pressed. + */ + if (power_button_signal_asserted() && + !gpio_get_level(GPIO_BTN_VOLD_L) && + !gpio_get_level(GPIO_BTN_VOLU_L)) + host_set_single_event(EC_HOST_EVENT_KEYBOARD_RECOVERY); + /* * Enable CC lines after all GPIO have been initialized. Note, it is * important that this is enabled after the CC_DEVICE_ODL lines are -- cgit v1.2.1