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 /board/palkia | |
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 'board/palkia')
-rw-r--r-- | board/palkia/keyboard_customization.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/board/palkia/keyboard_customization.c b/board/palkia/keyboard_customization.c index e83b5ecb99..03c29a5720 100644 --- a/board/palkia/keyboard_customization.c +++ b/board/palkia/keyboard_customization.c @@ -10,7 +10,7 @@ #include "keyboard_protocol.h" #include "keyboard_raw.h" -uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { +static uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { {0x0021, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, {0x0015, 0x0000, 0x0000, 0x000d, 0x000e, 0x0016, 0x0000, 0x001c}, @@ -29,6 +29,19 @@ uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { {0x0000, 0x000a, 0xe074, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, }; +uint16_t get_scancode_set2(uint8_t row, uint8_t col) +{ + if (col < KEYBOARD_COLS_MAX && row < KEYBOARD_ROWS) + return scancode_set2[col][row]; + return 0; +} + +void set_scancode_set2(uint8_t row, uint8_t col, uint16_t val) +{ + if (col < KEYBOARD_COLS_MAX && row < KEYBOARD_ROWS) + scancode_set2[col][row] = val; +} + void board_keyboard_drive_col(int col) { /* Drive all lines to high */ @@ -49,7 +62,7 @@ void board_keyboard_drive_col(int col) } #ifdef CONFIG_KEYBOARD_DEBUG -char keycap_label[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { +static char keycap_label[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { {'c', KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO}, {KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO, @@ -83,4 +96,17 @@ char keycap_label[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { {KLLI_UNKNO, KLLI_F8, KLLI_RIGHT, KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO, KLLI_UNKNO}, }; + +char get_keycap_label(uint8_t row, uint8_t col) +{ + if (col < KEYBOARD_COLS_MAX && row < KEYBOARD_ROWS) + return keycap_label[col][row]; + return KLLI_UNKNO; +} + +void set_keycap_label(uint8_t row, uint8_t col, char val) +{ + if (col < KEYBOARD_COLS_MAX && row < KEYBOARD_ROWS) + keycap_label[col][row] = val; +} #endif |