From 67a08d2ff371a653190227fe30bfa250174b1d65 Mon Sep 17 00:00:00 2001 From: Wealian Liao Date: Thu, 8 Jul 2021 11:46:41 +0800 Subject: zephyr: cros_kb_raw_npcx: Add output high driver config option This CL adds a Kconfig option 'CROS_KB_RAW_NPCX_KSO_HIGH_DRIVE' for npcx output buffer high driver function. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Wealian Liao Change-Id: I91f98581f43ca88991345b2e23ab11e5b99353be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077763 Reviewed-by: Keith Short Commit-Queue: Keith Short --- zephyr/drivers/cros_kb_raw/Kconfig | 11 +++++++++++ zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c | 2 +- zephyr/shim/include/config_chip.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/zephyr/drivers/cros_kb_raw/Kconfig b/zephyr/drivers/cros_kb_raw/Kconfig index 3109009da5..a037cdd451 100644 --- a/zephyr/drivers/cros_kb_raw/Kconfig +++ b/zephyr/drivers/cros_kb_raw/Kconfig @@ -12,6 +12,17 @@ menuconfig CROS_KB_RAW_NPCX kscan interface so we can continue to use most of the existing keyboard-scanning code in ECOS. +if CROS_KB_RAW_NPCX + +config CROS_KB_RAW_NPCX_KSO_HIGH_DRIVE + bool "Enable quasi-bidirectional buffers for KSO pins" + help + This option enables quasi-bidirectional buffers for KSO pins. The + low-impedance high drive is active when ec changes the output data + buffers from 0 to 1, thereby reducing the low-to-high transition time. + +endif # CROS_KB_RAW_NPCX + menuconfig CROS_KB_RAW_ITE bool "ITE raw-keyboard-scan driver for the Zephyr shim" depends on SOC_FAMILY_RISCV_ITE diff --git a/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c b/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c index 69d71e096b..00965b74ca 100644 --- a/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c +++ b/zephyr/drivers/cros_kb_raw/cros_kb_raw_npcx.c @@ -190,7 +190,7 @@ static int cros_kb_raw_npcx_init(const struct device *dev) * Select quasi-bidirectional buffers for KSO pins. It reduces the * low-to-high transition time. This feature only supports in npcx7. */ - if (IS_ENABLED(CONFIG_KEYBOARD_KSO_HIGH_DRIVE)) { + if (IS_ENABLED(CONFIG_CROS_KB_RAW_NPCX_KSO_HIGH_DRIVE)) { SET_FIELD(inst->KBSCTL, NPCX_KBSCTL_KBHDRV_FIELD, 0x01); } diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 317591ff86..18a0861cd0 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -62,6 +62,7 @@ #undef CONFIG_CONSOLE_UART /* Only used by the Chromium EC chip drivers */ #undef CONFIG_I2C_MULTI_PORT_CONTROLLER /* Not required by I2C shim */ #undef CONFIG_IRQ_COUNT /* Only used by Chromium EC core drivers */ +#undef CONFIG_KEYBOARD_KSO_HIGH_DRIVE /* Used by the Chromium EC chip drivers */ #undef CONFIG_LTO /* Link time optimization enabled by Zephyr build system */ #undef CONFIG_STACK_SIZE /* Only used in Chromium EC core init code */ #ifndef CONFIG_FPU -- cgit v1.2.1