mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-25 10:45:02 +00:00
firmware: Using power button for selection
BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot and try to make selections in detachable
UI with power button.
Change-Id: I0a3178eb3fa2c8c1ed77d96fdefa948eaea508e5
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/427220
This commit is contained in:
@@ -827,9 +827,11 @@ enum VbKeyCode_t {
|
||||
VB_KEY_CTRL_ENTER = 0x104
|
||||
};
|
||||
|
||||
/* Button codes match that of 8042 ascii values */
|
||||
enum VbButtonCode_t {
|
||||
VB_BUTTON_VOL_UP = 0x62,
|
||||
VB_BUTTON_VOL_DOWN = 0x63
|
||||
VB_BUTTON_VOL_DOWN = 0x63,
|
||||
VB_BUTTON_POWER = 0x90
|
||||
};
|
||||
|
||||
/* Flags for additional information.
|
||||
|
||||
@@ -45,6 +45,12 @@ static int VbWantShutdownMenu(uint32_t gbb_flags)
|
||||
if (gbb_flags & GBB_FLAG_DISABLE_LID_SHUTDOWN)
|
||||
shutdown_request &= ~VB_SHUTDOWN_REQUEST_LID_CLOSED;
|
||||
|
||||
/*
|
||||
* In detachables, disabling shutdown due to power button.
|
||||
* We are using it for selection instead.
|
||||
*/
|
||||
shutdown_request &= ~VB_SHUTDOWN_REQUEST_POWER_BUTTON;
|
||||
|
||||
return !!shutdown_request;
|
||||
}
|
||||
|
||||
@@ -671,6 +677,7 @@ VbError_t vb2_developer_menu(struct vb2_context *ctx, VbCommonParams *cparams)
|
||||
current_menu_idx++;
|
||||
vb2_print_current_menu();
|
||||
break;
|
||||
case VB_BUTTON_POWER:
|
||||
case VB_KEY_RIGHT:
|
||||
// temporarily using this as a stand in for power button
|
||||
// until get power button bypassed
|
||||
@@ -922,6 +929,7 @@ VbError_t vb2_recovery_menu(struct vb2_context *ctx, VbCommonParams *cparams)
|
||||
current_menu_idx++;
|
||||
vb2_print_current_menu();
|
||||
break;
|
||||
case VB_BUTTON_POWER:
|
||||
case VB_KEY_RIGHT:
|
||||
// temporarily using this as a stand in for
|
||||
// power button until get power button bypassed
|
||||
|
||||
Reference in New Issue
Block a user