summaryrefslogtreecommitdiff
path: root/common/keyboard_scan.c
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2018-05-16 17:28:27 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-05-16 22:49:42 -0700
commited45aba4bd123325ea8c97220c5f45ed2326b311 (patch)
tree3a495125130e88282131b18f82d7e7796fe40517 /common/keyboard_scan.c
parent0f41a73dbf9ac5ec569ab53600b7b8e95453a284 (diff)
downloadchrome-ec-ed45aba4bd123325ea8c97220c5f45ed2326b311.tar.gz
keyboard_scan: Add refresh and power button boot key options
Make Esc+Refresh+Power on Grunt enter Recovery Mode. If Power is released fast: [0.045303 KB init state: -- 02 08 -- -- -- -- -- -- -- -- -- --] Add CONFIG_KEYBOARD_IGNORE_REFRESH_BOOT_KEY to handle this case. If Power is held longer: [0.045448 KB init state: 08 0a 08 08 08 -- 08 -- 08 08 -- 08 08] Add CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI3 to handle this case. BUG=b:79758966 BRANCH=none TEST=Esc+Refresh+Power gives recovery screen on Grunt Change-Id: I43a7d485535ff7b0d9bfce59f28c0049ee989818 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1063032 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Diffstat (limited to 'common/keyboard_scan.c')
-rw-r--r--common/keyboard_scan.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index e63c164100..fee48e6a26 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -542,19 +542,23 @@ static uint32_t check_key_list(const uint8_t *state)
/* Make copy of current debounced state. */
memcpy(curr_state, state, sizeof(curr_state));
-#ifdef CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2
+#ifdef KEYBOARD_MASK_PWRBTN
/*
- * Check if KSI2 is asserted for all columns due to power button hold,
- * and ignore it if so.
+ * Check if KSI2 or KSI3 is asserted for all columns due to power
+ * button hold, and ignore it if so.
*/
for (c = 0; c < KEYBOARD_COLS; c++)
- if ((keyscan_config.actual_key_mask[c] & KEYBOARD_MASK_KSI2) &&
- !(curr_state[c] & KEYBOARD_MASK_KSI2))
+ if ((keyscan_config.actual_key_mask[c] & KEYBOARD_MASK_PWRBTN)
+ && !(curr_state[c] & KEYBOARD_MASK_PWRBTN))
break;
if (c == KEYBOARD_COLS)
for (c = 0; c < KEYBOARD_COLS; c++)
- curr_state[c] &= ~KEYBOARD_MASK_KSI2;
+ curr_state[c] &= ~KEYBOARD_MASK_PWRBTN;
+#endif
+
+#ifdef CONFIG_KEYBOARD_IGNORE_REFRESH_BOOT_KEY
+ curr_state[KEYBOARD_COL_REFRESH] &= ~KEYBOARD_MASK_REFRESH;
#endif
/* Update mask with all boot keys that were pressed. */