ryu: update recovery key combinations

Update the recovery key combination to: power key + volume up when the
AP is off.
Add a fastboot key combination: power key + volume down when the AP is
off.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=smaug
BUG=chrome-os-partner:41629
TEST=on Ryu, shutdown the AP, press "power+volup" or "power+voldown" and
see the right trace.

Change-Id: I42cf368d42885717758fc4b494af5c8a16fc58b0
Reviewed-on: https://chromium-review.googlesource.com/278323
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vincent Palatin
2015-06-17 16:03:20 -07:00
committed by ChromeOS Commit Bot
parent 313623afee
commit ca5ecf18e4
2 changed files with 29 additions and 9 deletions

View File

@@ -198,15 +198,6 @@ static void board_init(void)
/* Enable pericom BC1.2 interrupts. */
gpio_enable_interrupt(GPIO_USBC_BC12_INT_L);
/*
* 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);
/*
* Initialize AP and SH console forwarding USARTs and queues.
*/
@@ -229,6 +220,32 @@ static void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
static void board_startup_key_combo(void)
{
int vold = !gpio_get_level(GPIO_BTN_VOLD_L);
int volu = !gpio_get_level(GPIO_BTN_VOLU_L);
int pwr = power_button_signal_asserted();
/*
* Determine recovery mode is requested by the power and
* voldown buttons being pressed (while device was off).
*/
if (pwr && vold && !volu) {
host_set_single_event(EC_HOST_EVENT_KEYBOARD_RECOVERY);
CPRINTS("> RECOVERY mode");
}
/*
* Determine fastboot mode is requested by the power and
* voldown buttons being pressed (while device was off).
*/
if (pwr && volu && !vold) {
host_set_single_event(EC_HOST_EVENT_KEYBOARD_FASTBOOT);
CPRINTS("> FASTBOOT mode");
}
}
DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_startup_key_combo, HOOK_PRIO_DEFAULT);
/* power signal list. Must match order of enum power_signal. */
const struct power_signal_info power_signal_list[] = {
{GPIO_AP_HOLD, 1, "AP_HOLD"},

View File

@@ -428,6 +428,9 @@ enum host_event_code {
/* EC encountered a panic, triggering a reset */
EC_HOST_EVENT_PANIC = 24,
/* Keyboard fastboot combo has been pressed */
EC_HOST_EVENT_KEYBOARD_FASTBOOT = 25,
/*
* The high bit of the event mask is not used as a host event code. If
* it reads back as set, then the entire event mask should be