diff options
author | Wai-Hong Tam <waihong@google.com> | 2021-03-23 09:52:25 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-24 02:15:38 +0000 |
commit | 40b2ce056a512e30b5a8c3d368d9d19e35324b7b (patch) | |
tree | dcee5c5a0bab70faf76c9f67f1fdf261de2a6acf /zephyr | |
parent | 3206186b4e234027516c1d354084615a56114172 (diff) | |
download | chrome-ec-40b2ce056a512e30b5a8c3d368d9d19e35324b7b.tar.gz |
zephyr: shim the MKBP-protocol keyboard support
The MKBP protocol is usually used on ARM-based platforms
for keyboard communication. It sends the raw scan code,
like (row, col), to the AP and the kernel driver will map
the scan code to a key.
BRANCH=None
BUG=b:183445211
TEST=Built the image correctly. With the following CLs, tested
the keyboard working on Lazor.
Change-Id: I9453c3e6f6629fc11135e56bdfe909635844932c
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2782365
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/CMakeLists.txt | 2 | ||||
-rw-r--r-- | zephyr/Kconfig.keyboard | 8 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 660b59da20..e59945002c 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -236,6 +236,8 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042 "${PLATFORM_EC}/common/keyboard_8042.c" "${PLATFORM_EC}/common/keyboard_8042_sharedlib.c") +zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_MKBP + "${PLATFORM_EC}/common/keyboard_mkbp.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD_VIVALDI "${PLATFORM_EC}/common/keyboard_vivaldi.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PWM_KBLIGHT diff --git a/zephyr/Kconfig.keyboard b/zephyr/Kconfig.keyboard index bacc43f4dc..e2360e262f 100644 --- a/zephyr/Kconfig.keyboard +++ b/zephyr/Kconfig.keyboard @@ -38,6 +38,14 @@ config PLATFORM_EC_KEYBOARD_PROTOCOL_8042 See here for docs: https://wiki.osdev.org/%228042%22_PS/2_Controller +config PLATFORM_EC_KEYBOARD_PROTOCOL_MKBP + bool "mkbp" + help + Use the MKBP protocol to communicate with the AP. This protocol is + usually used on ARM-based platforms. It sends the raw scan code, like + (row, col), to the AP and the kernel driver will map this scan code to + a key. + endchoice # PLATFORM_EC_KEYBOARD config PLATFORM_EC_KEYBOARD_BOARD_CONFIG diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 72eb343ef0..66fc7d5596 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -381,6 +381,11 @@ enum battery_type { #define CONFIG_KEYBOARD_PROTOCOL_8042 #endif /* CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042 */ +#undef CONFIG_KEYBOARD_PROTOCOL_MKBP +#ifdef CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_MKBP +#define CONFIG_KEYBOARD_PROTOCOL_MKBP +#endif + #undef CONFIG_CMD_KEYBOARD #ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_KEYBOARD_8042 #define CONFIG_CMD_KEYBOARD |