summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-05-08 15:30:30 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-11 22:45:28 +0000
commit3872ac2772f97cbd919d1537599c52a749b2b8ec (patch)
treefd7cc0b2e93a08a7bc61836999e34f0063d07925
parentba9dec325753f75bc3ba605cd321b4d2b6635bd1 (diff)
downloadchrome-ec-3872ac2772f97cbd919d1537599c52a749b2b8ec.tar.gz
keyboard_scan: Update the default scan delay to compensate H1 signal delay
The default value of the keyboard scan delay was measured at around 2013. That time H1 hadn't been introduced. The keyscan lines go straightforward to the keyboard matrix. In recent Chrome OS clamshell/convertible devices, the KSO2 line goes through H1. It adds more signal delay for inverting the signal. The default keyboard scan rate seems too fast for the KSO2 line. When an user presses Refresh key (KSO2, KSI2), EC iterates to assert the next KSO3, KSO2 still remains asserted that causes T key (KSO3, KSI2) detected unexpectedly. Most of the boards override this default value. But a board, which just uses the default value, may have this Refresh-triggering-T bug. People debug the same issue over and over again. Should update the default value and save people time. BRANCH=None BUG=b:156007029, b:155696516 TEST=Press Refresh key, only Refresh key detected, no sign of T key. Change-Id: I5a9ee8058adcac123fdd5500d478913926b00497 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2190953 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
-rw-r--r--common/keyboard_scan.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index 5e147a1f46..82c811dd92 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -56,7 +56,18 @@
#ifndef CONFIG_KEYBOARD_BOARD_CONFIG
/* Use default keyboard scan config, because board didn't supply one */
struct keyboard_scan_config keyscan_config = {
+#ifdef CONFIG_KEYBOARD_COL2_INVERTED
+ /*
+ * CONFIG_KEYBOARD_COL2_INVERTED is defined for passing the column 2
+ * to H1 which inverts the signal. The signal passing through H1
+ * adds more delay. Need a larger delay value. Otherwise, pressing
+ * Refresh key will also trigger T key, which is in the next scanning
+ * column line. See http://b/156007029.
+ */
+ .output_settle_us = 80,
+#else
.output_settle_us = 50,
+#endif /* CONFIG_KEYBOARD_COL2_INVERTED */
.debounce_down_us = 9 * MSEC,
.debounce_up_us = 30 * MSEC,
.scan_period_us = 3 * MSEC,