mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
power_button_x86: Set PB state to ON in recovery mode
This patch sets the initial power button state to on if recovery mode is requested. BUG=b:37274183 BRANCH=none TEST=Verify EC boots AP immediately in recovery mode on Fizz. Verify EC doesn't boot AP immediately in normal mode. Change-Id: Ib24eb6c6b7e9200cf7ba6af3e486337da3c68355 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/514209 Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
c35fad0f2b
commit
bb559311c8
@@ -212,6 +212,7 @@ static void set_initial_pwrbtn_state(void)
|
||||
} else {
|
||||
CPRINTS("PB init-jumped");
|
||||
}
|
||||
return;
|
||||
} else if ((reset_flags & RESET_FLAG_AP_OFF) ||
|
||||
(keyboard_scan_get_boot_keys() == BOOT_KEY_DOWN_ARROW)) {
|
||||
/*
|
||||
@@ -227,22 +228,18 @@ static void set_initial_pwrbtn_state(void)
|
||||
*/
|
||||
CPRINTS("PB init-off");
|
||||
power_button_pch_release();
|
||||
} else if (power_button_is_pressed()) {
|
||||
CPRINTS("PB init-on");
|
||||
pwrbtn_state = PWRBTN_STATE_INIT_ON;
|
||||
} else {
|
||||
/*
|
||||
* All other EC reset conditions power on the main processor so
|
||||
* it can verify the EC.
|
||||
*/
|
||||
#if defined(CONFIG_BRINGUP) || defined(CONFIG_POWER_BUTTON_INIT_IDLE)
|
||||
CPRINTS("PB idle");
|
||||
pwrbtn_state = PWRBTN_STATE_IDLE;
|
||||
#else
|
||||
CPRINTS("PB init-on");
|
||||
pwrbtn_state = PWRBTN_STATE_INIT_ON;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
pwrbtn_state = PWRBTN_STATE_INIT_ON;
|
||||
|
||||
#if defined(CONFIG_BRINGUP) || defined(CONFIG_POWER_BUTTON_INIT_IDLE)
|
||||
if (!power_button_is_pressed() &&
|
||||
!host_is_event_set(EC_HOST_EVENT_KEYBOARD_RECOVERY))
|
||||
pwrbtn_state = PWRBTN_STATE_IDLE;
|
||||
#endif
|
||||
CPRINTS("PB %s",
|
||||
pwrbtn_state == PWRBTN_STATE_INIT_ON ? "init-on" : "idle");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user