summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo-Tsai <leocx_tsai@compal.corp-partner.google.com>2022-09-29 15:04:33 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-05 02:11:29 +0000
commitb204b7dbf1ab9a1e9248fefb4ac99dcc5ae618dd (patch)
tree65fb7d5fec6ff239afc003c57ce0f80a724809d4
parent80b8b9ac7d87644112a77cb204486d776a386db5 (diff)
downloadchrome-ec-b204b7dbf1ab9a1e9248fefb4ac99dcc5ae618dd.tar.gz
zephyr: add customization keyboard support
Add support for customization keyboard, some projects need to use a custom matrix. BRANCH=none BUG=b:246873434 TEST=zmake build board pass Signed-off-by: Leo-Tsai <leocx_tsai@compal.corp-partner.google.com> Change-Id: I0dd6c6bf5dcb3505ba4b8ae270ff3460edfbabe5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3928565 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: SamSP Liu <samsp_liu2@compal.corp-partner.google.com>
-rw-r--r--util/config_allowed.txt1
-rw-r--r--zephyr/Kconfig.keyboard15
-rw-r--r--zephyr/shim/include/config_chip.h5
3 files changed, 20 insertions, 1 deletions
diff --git a/util/config_allowed.txt b/util/config_allowed.txt
index bca51e46e1..78198e312a 100644
--- a/util/config_allowed.txt
+++ b/util/config_allowed.txt
@@ -564,7 +564,6 @@ CONFIG_ITE_FLASH_SUPPORT
CONFIG_KEYBOARD_ASSISTANT_KEY
CONFIG_KEYBOARD_BACKLIGHT
CONFIG_KEYBOARD_BOOT_KEYS
-CONFIG_KEYBOARD_CUSTOMIZATION
CONFIG_KEYBOARD_FACTORY_TEST
CONFIG_KEYBOARD_IRQ_GPIO
CONFIG_KEYBOARD_KSO_BASE
diff --git a/zephyr/Kconfig.keyboard b/zephyr/Kconfig.keyboard
index f7c0df77ee..e0f1b2517e 100644
--- a/zephyr/Kconfig.keyboard
+++ b/zephyr/Kconfig.keyboard
@@ -82,6 +82,21 @@ config PLATFORM_EC_KEYBOARD_VIVALDI
- A response to EC_CMD_GET_KEYBD_CONFIG command.
- Boards can specify their custom layout for top keys.
+config PLATFORM_EC_KEYBOARD_CUSTOMIZATION
+ bool "Support keyboard customization"
+ help
+ Enable support for customization keyboard, some boards need to custom matrix
+ because those board keyboard layout doesn't follow a common matrix.
+
+ If define, the board layer
+ needs to implement:
+ 1. the scancode_set2 and keycap_label array
+ 2. keyboard_customization.h which is similar to keyboard_config.h
+
+ Note that if your board has the standard chromeos keyboard layout other
+ than the top row, and you are looking only for top row customization,
+ then you should be looking at overriding board_vivaldi_keybd_config() instead.
+
choice PLATFORM_EC_KEYBOARD_PWRBTN_MODE
prompt "Select the impact of pressing the power button"
help
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 75c27dd32d..99424cb0b8 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -702,6 +702,11 @@ extern char mock_jump_data[sizeof(struct jump_data) + 256];
#define CONFIG_KEYBOARD_VIVALDI
#endif
+#undef CONFIG_KEYBOARD_CUSTOMIZATION
+#ifdef CONFIG_PLATFORM_EC_KEYBOARD_CUSTOMIZATION
+#define CONFIG_KEYBOARD_CUSTOMIZATION
+#endif
+
#undef CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2
#ifdef CONFIG_PLATFORM_EC_KEYBOARD_PWRBTN_ASSERTS_KSI2
#define CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI2