summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2016-10-04 11:24:07 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2016-11-22 00:00:10 +0000
commit3bfd179ea9e7cea1a5dce4dbdb601f8f670e0d65 (patch)
tree9904f73de7a3354753c8a397d60304dd7171b840
parentbe7d8f5c1eab68e335463ab80165eb5850a5d5e0 (diff)
downloadchrome-ec-3bfd179ea9e7cea1a5dce4dbdb601f8f670e0d65.tar.gz
UPSTREAM: Use CONFIG_KEYBOARD_DEBUG for keyboard debug printf
Remove keyboard printk like: KB wait/poll when not debugging keyboard. BUG=none BRANCH=none TEST=compile. Change-Id: I9743eab4597d2b661ae7b21c0aab4e1ffdcdb9a4 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/394068 (cherry picked from commit ce92dd27dfa2b60cf4443da5eb47c51d8c7170bf) Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/404895
-rw-r--r--common/keyboard_scan.c14
-rw-r--r--include/config.h3
2 files changed, 14 insertions, 3 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index b930ac20cc..92b675e22c 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -27,6 +27,14 @@
#define CPRINTF(format, args...) cprintf(CC_KEYSCAN, format, ## args)
#define CPRINTS(format, args...) cprints(CC_KEYSCAN, format, ## args)
+#ifdef CONFIG_KEYBOARD_DEBUG
+#define CPUTS5(outstr) cputs(CC_KEYSCAN, outstr)
+#define CPRINTS5(format, args...) cprints(CC_KEYBOARD, format, ## args)
+#else
+#define CPUTS5(outstr)
+#define CPRINTS5(format, args...)
+#endif
+
#define SCAN_TIME_COUNT 32 /* Number of last scan times to track */
/* If we're waiting for a scan to happen, we'll give it this long */
@@ -434,7 +442,7 @@ static int check_keys_changed(uint8_t *state)
if (print_state_changes)
print_state(state, "state");
-#ifdef PRINT_SCAN_TIMES
+#ifdef CONFIG_KEYBOARD_PRINT_SCAN_TIMES
/* Print delta times from now back to each previous scan */
CPRINTF("[%T kb deltaT");
for (i = 0; i < SCAN_TIME_COUNT; i++) {
@@ -582,7 +590,7 @@ void keyboard_scan_task(void)
while (1) {
/* Enable all outputs */
- CPRINTS("KB wait");
+ CPRINTS5("KB wait");
keyboard_raw_enable_interrupt(1);
@@ -634,7 +642,7 @@ void keyboard_scan_task(void)
force_poll = 0;
/* Enter polling mode */
- CPRINTS("KB poll");
+ CPRINTS5("KB poll");
keyboard_raw_enable_interrupt(0);
keyboard_raw_drive_column(KEYBOARD_COLUMN_NONE);
diff --git a/include/config.h b/include/config.h
index 07e08bf17b..076d71eb87 100644
--- a/include/config.h
+++ b/include/config.h
@@ -850,6 +850,9 @@
*/
#undef CONFIG_KEYBOARD_POST_SCAN_CLOCKS
+/* Print keyboard scan time intervals. */
+#undef CONFIG_KEYBOARD_PRINT_SCAN_TIMES
+
/*
* Call board-supplied keyboard_suppress_noise() function when the debounced
* keyboard state changes. Some boards use this to send a signal to the audio