mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
keyboard_scan: Support boot key recognition with stuck KSI2
For certain board configurations, KSI2 will be stuck asserted for all scan columns if the power button is held. We must be aware of this case in order to correctly handle recovery mode key combinations. BUG=chrome-os-partner:54602 BRANCH=None TEST=Manual on gru. Do three-key salute, verify EC detects recovery mode. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I03d76e1121107484f79520745858388f6cae096c Reviewed-on: https://chromium-review.googlesource.com/357590 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
1457ea2155
commit
adac37bf0c
@@ -45,6 +45,7 @@
|
||||
#define CONFIG_KEYBOARD_BOARD_CONFIG
|
||||
#define CONFIG_KEYBOARD_COL2_INVERTED
|
||||
#define CONFIG_KEYBOARD_PROTOCOL_MKBP /* Instead of 8042 protocol of keyboard */
|
||||
#define CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2
|
||||
#define CONFIG_LTO
|
||||
#define CONFIG_POWER_BUTTON
|
||||
#define CONFIG_VBOOT_HASH
|
||||
|
||||
@@ -524,6 +524,21 @@ static int check_key(const uint8_t *state, int index, int mask)
|
||||
allowed_mask[index] |= mask;
|
||||
allowed_mask[KEYBOARD_COL_REFRESH] |= KEYBOARD_MASK_REFRESH;
|
||||
|
||||
#ifdef CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2
|
||||
/*
|
||||
* Check if KSI2 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) &&
|
||||
!(state[c] & KEYBOARD_MASK_KSI2))
|
||||
break;
|
||||
|
||||
if (c == KEYBOARD_COLS)
|
||||
for (c = 0; c < KEYBOARD_COLS; c++)
|
||||
allowed_mask[c] |= KEYBOARD_MASK_KSI2;
|
||||
#endif
|
||||
|
||||
for (c = 0; c < KEYBOARD_COLS; c++) {
|
||||
if (state[c] & ~allowed_mask[c])
|
||||
return 0; /* Disallowed key pressed */
|
||||
|
||||
@@ -1227,6 +1227,13 @@
|
||||
*/
|
||||
#define CONFIG_KEYBOARD_KSO_BASE 0
|
||||
|
||||
/*
|
||||
* For certain board configurations, KSI2 will be stuck asserted for all
|
||||
* scan columns if the power button is held. We must be aware of this case
|
||||
* in order to correctly handle recovery mode key combinations.
|
||||
*/
|
||||
#undef CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2
|
||||
|
||||
/* Enable extra debugging output from keyboard modules */
|
||||
#undef CONFIG_KEYBOARD_DEBUG
|
||||
|
||||
|
||||
@@ -59,5 +59,6 @@
|
||||
#define KEYBOARD_COL_KEY_2 4
|
||||
#define KEYBOARD_ROW_KEY_2 6
|
||||
#define KEYBOARD_MASK_KEY_2 KEYBOARD_ROW_TO_MASK(KEYBOARD_ROW_KEY_2)
|
||||
#define KEYBOARD_MASK_KSI2 KEYBOARD_ROW_TO_MASK(2)
|
||||
|
||||
#endif /* __CROS_EC_KEYBOARD_CONFIG_H */
|
||||
|
||||
Reference in New Issue
Block a user