diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-29 09:26:04 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-06 19:31:52 +0000 |
commit | 75d4c1878d92a47c22abf257a41ee3e66b513b1d (patch) | |
tree | f6a5b86e039c4e7b4a8fe624a39b94003c17ac66 | |
parent | f4546fa1671e31afa5f03fe85e5e781f5295ac73 (diff) | |
download | chrome-ec-75d4c1878d92a47c22abf257a41ee3e66b513b1d.tar.gz |
zephyr: Make HAS_TASK_KEYSCAN a Kconfig option
This option is implied so we may as well create it. Set it to be
visible (and automatically enabled) only if PLATFORM_EC_KEYBOARD is
enabled. This mostly mimics the current behaviour.
Also select the keyproto task automatically if
PLATFORM_EC_KEYBOARD_PROTOCOL_8042 is enabled, since that feature
cannot work without the task. If PLATFORM_EC_KEYBOARD_PROTOCOL_8042
is not enabled there is no need for the task.
BUG=b:176449230
BRANCH=none
TEST=ninja -C /tmp/z/vol/build-ro menuconfig
Check the operation of HAS_TASK_KEYSCAN and PLATFORM_EC_KEYBOARD
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I576f2ee3560a307e00d11bc6b8b6c04acb81dd24
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2606574
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/Kconfig | 13 | ||||
-rw-r--r-- | zephyr/Kconfig.tasks | 20 | ||||
-rw-r--r-- | zephyr/shim/include/shimmed_tasks.h | 4 |
3 files changed, 28 insertions, 9 deletions
diff --git a/zephyr/Kconfig b/zephyr/Kconfig index 3ef9f0e379..171a147f6d 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -146,27 +146,26 @@ endif # PLATFORM_EC_FLASH menuconfig PLATFORM_EC_KEYBOARD bool "Enable keyboard support" + select HAS_TASK_KEYSCAN default y help Enable compilation of support for scanning a keyboard and providing the resulting input to the AP over the host interface. This consists of a keyboard-scanning task which provides key scans via it calling keyboard_state_changed() (for i8042) or its client calling - keyboard_scan_get_state() (for MKBP). This implies HAS_TASK_KEYSCAN. + keyboard_scan_get_state() (for MKBP). -if PLATFORM_EC_KEYBOARD + Enabling this automatically enables HAS_TASK_KEYSCAN since keyboard + scanning must run in its own task. -config TASK_KEYSCAN_STACK_SIZE - hex "keyscan task stack size" - default 0x200 - help - The size of the keyboard scan task stack. +if PLATFORM_EC_KEYBOARD choice "Protocol select" prompt "Select the keyboard protocol to use" config PLATFORM_EC_KEYBOARD_PROTOCOL_8042 bool "i8042" + select HAS_TASK_KEYPROTO help Use the i8042 protocol to communicate with the AP. This dates from the Intel 8042 keyboard controller chip released in 1976. It uses two-way diff --git a/zephyr/Kconfig.tasks b/zephyr/Kconfig.tasks index 3668ed5817..37d54814ee 100644 --- a/zephyr/Kconfig.tasks +++ b/zephyr/Kconfig.tasks @@ -48,6 +48,7 @@ endif # HAS_TASK_CHIPSET config HAS_TASK_KEYPROTO bool "Keyboard-protocol task (x86)" + depends on PLATFORM_EC_KEYBOARD_PROTOCOL_8042 help This turns on the keyproto task which handles conversion of keyboard scans into i8042 messages on x86 platforms. This is not used or needed @@ -64,6 +65,25 @@ config TASK_KEYPROTO_STACK_SIZE endif # HAS_TASK_KEYPROTO +config HAS_TASK_KEYSCAN + bool "Keyboard-scanning task" + depends on PLATFORM_EC_KEYBOARD + help + This turns on the keyscan task which handles scanning the keyboard + and producing a list of changes in the key state. This list can either + be sent to the keyboard-protocol task or directly to the AP for + processing. + +if HAS_TASK_KEYSCAN + +config TASK_KEYSCAN_STACK_SIZE + hex "Stack size" + default 0x200 + help + The stack size of the keyscan task. + +endif # HAS_TASK_KEYSCAN + config HAS_TASK_POWERBTN bool "Power-button task (x86)" help diff --git a/zephyr/shim/include/shimmed_tasks.h b/zephyr/shim/include/shimmed_tasks.h index 655df56cd4..4848c8d1ce 100644 --- a/zephyr/shim/include/shimmed_tasks.h +++ b/zephyr/shim/include/shimmed_tasks.h @@ -15,9 +15,9 @@ #define CONFIG_HOSTCMD_EVENTS #endif /* CONFIG_PLATFORM_EC_HOSTCMD */ -#ifdef CONFIG_PLATFORM_EC_KEYBOARD +#ifdef CONFIG_HAS_TASK_KEYSCAN #define HAS_TASK_KEYSCAN 1 -#endif /* CONFIG_PLATFORM_EC_KEYBOARD */ +#endif /* CONFIG_HAS_TASK_KEYSCAN */ #ifdef CONFIG_HAS_TASK_KEYPROTO #define HAS_TASK_KEYPROTO 1 |