diff options
-rw-r--r-- | chip/npcx/keyboard_raw.c | 8 | ||||
-rw-r--r-- | chip/npcx/registers.h | 3 | ||||
-rw-r--r-- | include/config.h | 8 |
3 files changed, 19 insertions, 0 deletions
diff --git a/chip/npcx/keyboard_raw.c b/chip/npcx/keyboard_raw.c index 743520a96a..fa003c4336 100644 --- a/chip/npcx/keyboard_raw.c +++ b/chip/npcx/keyboard_raw.c @@ -25,6 +25,14 @@ void keyboard_raw_init(void) /* Ensure top-level interrupt is disabled */ keyboard_raw_enable_interrupt(0); + /* + * Select quasi-bidirectional buffers for KSO pins. It reduces the + * low-to-high transition time. This feature only supports in npcx7. + */ +#ifdef CONFIG_KEYBOARD_KSO_HIGH_DRIVE + SET_FIELD(NPCX_KBSCTL, NPCX_KBHDRV_FIELD, 0x01); +#endif + /* pull-up KBSIN 0-7 internally */ NPCX_KBSINPU = 0xFF; diff --git a/chip/npcx/registers.h b/chip/npcx/registers.h index 7b92fea6b2..15a630d7b2 100644 --- a/chip/npcx/registers.h +++ b/chip/npcx/registers.h @@ -302,6 +302,9 @@ #define NPCX_KBSMODE 1 #define NPCX_KBSIEN 2 #define NPCX_KBSINC 3 +#if defined(CHIP_FAMILY_NPCX7) +#define NPCX_KBHDRV_FIELD FIELD(6, 2) +#endif #define NPCX_KBSCFGINDX 0 /* KBSCAN definitions */ diff --git a/include/config.h b/include/config.h index 3ac4a98e2d..2b08abde9b 100644 --- a/include/config.h +++ b/include/config.h @@ -1527,6 +1527,14 @@ */ #undef CONFIG_KEYBOARD_TEST +/* + * Enable quasi-bidirectional buffers for KSO pins. It has an open-drain output + * and a low-impedance pull-up. The low-impedance pull-up is active when ec + * changes the output data buffers from 0 to 1, thereby reducing the + * low-to-high transition time. + */ +#undef CONFIG_KEYBOARD_KSO_HIGH_DRIVE + /*****************************************************************************/ /* Support common LED interface */ |