summaryrefslogtreecommitdiff
path: root/chip/npcx/keyboard_raw.c
diff options
context:
space:
mode:
authorMulin Chao <mlchao@nuvoton.com>2017-05-02 16:11:05 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-05-06 14:20:15 -0700
commite7969f8245a3cde164caf1fa03cfe655c7e61d1e (patch)
treee332d7a72b21ac02646f10affcfce3c775c60b3c /chip/npcx/keyboard_raw.c
parent1bbcaa8df44c761b50a8f1649d2ab778b3ebaee7 (diff)
downloadchrome-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>
Diffstat (limited to 'chip/npcx/keyboard_raw.c')
-rw-r--r--chip/npcx/keyboard_raw.c8
1 files changed, 8 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;