diff options
author | Mulin Chao <mlchao@nuvoton.com> | 2017-05-02 16:11:05 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-05-06 14:20:15 -0700 |
commit | e7969f8245a3cde164caf1fa03cfe655c7e61d1e (patch) | |
tree | e332d7a72b21ac02646f10affcfce3c775c60b3c | |
parent | 1bbcaa8df44c761b50a8f1649d2ab778b3ebaee7 (diff) | |
download | chrome-ec-e7969f8245a3cde164caf1fa03cfe655c7e61d1e.tar.gz |
npcx: keyboard: Add quasi-bidirectional buffers support on npcx7 ec.
This CL added the support for the quasi-bidirectional buffer which has
an open-drain output and a low-impedance pull-up resistance on KSO pins.
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.
Add CONFIG_KEYBOARD_KSO_HIGH_DRIVE to enable/disable this feature for
npcx7 series ec.
BRANCH=none
BUG=none
TEST=No build errors for all boards using npcx5 series.
Build poppy board and upload FW to platform. No issues found.
Change-Id: I138f0e433394816e1e5c58b5053580f202c1ac48
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/497189
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-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 */ |