diff options
author | Furquan Shaikh <furquan@chromium.org> | 2016-11-03 23:39:19 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-08 20:30:07 -0800 |
commit | 2fc7ba9df19d941fcd7b858d5ea6f3eb2b2398bd (patch) | |
tree | 01eb2aa25245695df6d37aa17c286d719e10fbfd /include/keyboard_scan.h | |
parent | bf4e1db093d7051491001e59195d30a915785066 (diff) | |
download | chrome-ec-2fc7ba9df19d941fcd7b858d5ea6f3eb2b2398bd.tar.gz |
common: Add new recovery mode button combination
This adds new key combination (Left_Shift+Esc+Refresh+Power) that triggers
recovery mode by setting a new host event
EC_HOST_EVENT_KEYBOARD_RECOVERY_HW_REINIT. This host event can be used
whenever user wants to request entry into recovery mode by
reinitializing all the hardware state (e.g. memory retraining).
BUG=chrome-os-partner:56643,chrome-os-partner:59352
BRANCH=None
TEST=Verified that device retrains memory in recovery mode
with (Left_Shift+Esc+Refresh+Power) on reef.
Change-Id: I2e08997acfd9e22270b8ce7a5b589cd5630645f8
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/407827
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/keyboard_scan.h')
-rw-r--r-- | include/keyboard_scan.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/include/keyboard_scan.h b/include/keyboard_scan.h index 41cdbdf611..faba74ffe1 100644 --- a/include/keyboard_scan.h +++ b/include/keyboard_scan.h @@ -49,21 +49,28 @@ extern struct keyboard_scan_config keyscan_config; /* Key held down at keyboard-controlled reset boot time. */ enum boot_key { - BOOT_KEY_NONE, /* No keys other than keyboard-controlled reset keys */ - BOOT_KEY_ESC, - BOOT_KEY_DOWN_ARROW, - BOOT_KEY_OTHER = -1, /* None of the above */ + /* No keys other than keyboard-controlled reset keys */ + BOOT_KEY_NONE = 0, + BOOT_KEY_ESC = (1 << 0), + BOOT_KEY_DOWN_ARROW = (1 << 1), + BOOT_KEY_LEFT_SHIFT = (1 << 2), }; #ifdef HAS_TASK_KEYSCAN /** - * Return the key held down at boot time in addition to the keyboard-controlled - * reset keys. Returns BOOT_KEY_OTHER if none of the keys specifically checked - * was pressed, or reset was not caused by a keyboard-controlled reset. + * Returns mask of all the keys held down at boot time in addition to the + * keyboard-controlled reset keys. If more than one boot key is held, mask bits + * will be set for each of those keys. Since more than one bit can be set, + * caller needs to ensure that boot keys match as intended. + * + * Returns BOOT_NONE if no additional key is held or if none of the keys + * specifically checked was pressed, or reset was not caused by a + * keyboard-controlled reset or if any key *other* than boot keys, power, or + * refresh is also pressed. */ -enum boot_key keyboard_scan_get_boot_key(void); +uint32_t keyboard_scan_get_boot_keys(void); #else -static inline enum boot_key keyboard_scan_get_boot_key(void) +static inline uint32_t keyboard_scan_get_boot_keys(void) { return BOOT_KEY_NONE; } |