summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/include/vboot_api.h4
-rw-r--r--firmware/lib/vboot_ui_menu.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 0dec8ef0..74605a9a 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -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.
diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c
index 3a45afac..dbd7ecc1 100644
--- a/firmware/lib/vboot_ui_menu.c
+++ b/firmware/lib/vboot_ui_menu.c
@@ -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