diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2022-05-16 17:18:50 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-17 18:53:10 +0000 |
commit | 201c108a37350ee83f214cd4c8cd046ab71b6eaa (patch) | |
tree | 8224e2fe5f56938be9523cb66829914a10710300 /common | |
parent | 5a3274d2d804b552da9f72b3fb18cd3acaf6c2a5 (diff) | |
download | chrome-ec-201c108a37350ee83f214cd4c8cd046ab71b6eaa.tar.gz |
keyboard: Add register_scancode_set2 API
register_scancode_set2 API allows each board to install an entire
scancode set.
BUG=b:220800586
BRANCH=None
TEST=buildall
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: Ideafef9a4fce6197e56eee6e28acceff77803681
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3644693
Reviewed-by: Parth Malkan <parthmalkan@google.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/keyboard_8042_sharedlib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/keyboard_8042_sharedlib.c b/common/keyboard_8042_sharedlib.c index 1d024d3f47..8617d13871 100644 --- a/common/keyboard_8042_sharedlib.c +++ b/common/keyboard_8042_sharedlib.c @@ -5,6 +5,8 @@ * Objects which can be shared between RO and RW for 8042 keyboard protocol. */ +#include <stddef.h> + #include "button.h" #include "keyboard_8042_sharedlib.h" #include "keyboard_config.h" @@ -37,6 +39,12 @@ static uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { #endif }; +void register_scancode_set2(uint16_t **scancode_set, size_t size) +{ + ASSERT(size == sizeof(scancode_set2)); + memcpy(scancode_set2, scancode_set, size); +} + uint16_t get_scancode_set2(uint8_t row, uint8_t col) { if (col < KEYBOARD_COLS_MAX && row < KEYBOARD_ROWS) |