diff options
author | Rajat Jain <rajatja@google.com> | 2020-04-03 00:58:13 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-21 21:32:50 +0000 |
commit | d4105005da492f8e20619cad88fdb15d6dee098f (patch) | |
tree | 44a9dc663c5d0e403ce254ff7d733631e3581b40 /include/keyboard_8042_sharedlib.h | |
parent | d2b73ad856c4ba697a2dfd8c4bf4263ffc18a5ce (diff) | |
download | chrome-ec-d4105005da492f8e20619cad88fdb15d6dee098f.tar.gz |
common: Make scancode table always mutable
Since the vivaldi requires the scancode to be mutable, and vivaldi
shall be enabled by default for all boards, thus make the scancode
table to be always mutable and get rid of the config option it hides
behind.
BUG=b:146501925
TEST=Build
BRANCH=firmware-hatch-12672.B
Signed-off-by: Rajat Jain <rajatja@google.com>
Change-Id: Iaedcd6d84caf31c91a61854f96414bcea38f5c2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2133825
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'include/keyboard_8042_sharedlib.h')
-rw-r--r-- | include/keyboard_8042_sharedlib.h | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/include/keyboard_8042_sharedlib.h b/include/keyboard_8042_sharedlib.h index 6ab5eb8df3..ea773cc6f4 100644 --- a/include/keyboard_8042_sharedlib.h +++ b/include/keyboard_8042_sharedlib.h @@ -17,13 +17,20 @@ struct button_8042_t { int repeat; }; -/* The standard Chrome OS keyboard matrix table. */ -#if defined(CONFIG_KEYBOARD_SCANCODE_MUTABLE) || \ - defined(CONFIG_KEYBOARD_CUSTOMIZATION) -extern uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS]; -#else -extern const uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS]; -#endif +/** + * Get the standard Chrome OS keyboard matrix set 2 scanset + * @param row Row number + * @param col Column number + * @return 0 on error, scanset for the (row,col) if successful + **/ +uint16_t get_scancode_set2(uint8_t row, uint8_t col); +/** + * Set the standard Chrome OS keyboard matrix set 2 scanset + * @param row Row number + * @param col Column number + * @param val Value to set + **/ +void set_scancode_set2(uint8_t row, uint8_t col, uint16_t val); /* Translation from scan code set 2 to set 1. */ extern const uint8_t scancode_translate_table[]; @@ -69,13 +76,27 @@ enum keycap_long_label_idx { KLLI_MAX }; -extern const char * const keycap_long_label[]; -#if defined(CONFIG_KEYBOARD_SCANCODE_MUTABLE) || \ - defined(CONFIG_KEYBOARD_CUSTOMIZATION) -extern char keycap_label[KEYBOARD_COLS_MAX][KEYBOARD_ROWS]; -#else -extern const char keycap_label[KEYBOARD_COLS_MAX][KEYBOARD_ROWS]; -#endif +/** + * Get the keycap "long version" label + * @param idx Index into keycap_long_label_idx[] + * @return "UNKNOWN" on error, long label for idx if successful + */ +const char *get_keycap_long_label(uint8_t idx); + +/** + * Get the keycap label + * @param row Row number + * @param col Column number + * @return KLLI_UNKNO on error, label for the (row,col) if successful + */ +char get_keycap_label(uint8_t row, uint8_t col); +/** + * Set the keycap label + * @param row Row number + * @param col Column number + * @param val Value to set + */ +void set_keycap_label(uint8_t row, uint8_t col, char val); #endif /* Button scancodes (Power, Volume Down, Volume Up, etc.) */ |