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:
Shelley Chen
2017-01-11 13:08:51 -08:00
committed by chrome-bot
parent 666bd54416
commit 53f8202a2a
2 changed files with 11 additions and 1 deletions

View File

@@ -827,9 +827,11 @@ enum VbKeyCode_t {
VB_KEY_CTRL_ENTER = 0x104 VB_KEY_CTRL_ENTER = 0x104
}; };
/* Button codes match that of 8042 ascii values */
enum VbButtonCode_t { enum VbButtonCode_t {
VB_BUTTON_VOL_UP = 0x62, VB_BUTTON_VOL_UP = 0x62,
VB_BUTTON_VOL_DOWN = 0x63 VB_BUTTON_VOL_DOWN = 0x63,
VB_BUTTON_POWER = 0x90
}; };
/* Flags for additional information. /* Flags for additional information.

View File

@@ -45,6 +45,12 @@ static int VbWantShutdownMenu(uint32_t gbb_flags)
if (gbb_flags & GBB_FLAG_DISABLE_LID_SHUTDOWN) if (gbb_flags & GBB_FLAG_DISABLE_LID_SHUTDOWN)
shutdown_request &= ~VB_SHUTDOWN_REQUEST_LID_CLOSED; 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; return !!shutdown_request;
} }
@@ -671,6 +677,7 @@ VbError_t vb2_developer_menu(struct vb2_context *ctx, VbCommonParams *cparams)
current_menu_idx++; current_menu_idx++;
vb2_print_current_menu(); vb2_print_current_menu();
break; break;
case VB_BUTTON_POWER:
case VB_KEY_RIGHT: case VB_KEY_RIGHT:
// temporarily using this as a stand in for power button // temporarily using this as a stand in for power button
// until get power button bypassed // until get power button bypassed
@@ -922,6 +929,7 @@ VbError_t vb2_recovery_menu(struct vb2_context *ctx, VbCommonParams *cparams)
current_menu_idx++; current_menu_idx++;
vb2_print_current_menu(); vb2_print_current_menu();
break; break;
case VB_BUTTON_POWER:
case VB_KEY_RIGHT: case VB_KEY_RIGHT:
// temporarily using this as a stand in for // temporarily using this as a stand in for
// power button until get power button bypassed // power button until get power button bypassed