summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/ryu/board.c10
1 files changed, 10 insertions, 0 deletions
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"
@@ -38,6 +39,15 @@ void unhandled_evt(enum gpio_signal signal)
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
* set low to specify device mode.