summaryrefslogtreecommitdiff
path: root/include/config.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-11 14:53:27 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-14 23:27:31 +0000
commit193f2298bd1a078f1ac07aacf9dc50132cbb39d3 (patch)
tree77f100d3f4b966ffe57de25bb44d5ec7bf31758e /include/config.h
parent1049bbbad81ab404c48cbc757c015cc8a373049b (diff)
downloadchrome-ec-193f2298bd1a078f1ac07aacf9dc50132cbb39d3.tar.gz
Enforce a minimum number of clocks between keyboard scans
When the EC CPU is running at a decreased clock frequency, frequent keyboard scans can starve other EC tasks of CPU and lead to dropped data or watchdog timeouts. Enforce a minimum number of EC clocks between keyboard scans to prevent this from happening. The default chosen (16000 clocks) is equal to the shortest post-scan delay (1 ms) of any current board when the AP is in S0, so this should have no effect when the AP is in S0. When the AP is in S3 or S5, we don't need to scan the keyboard as frequently anyway. This can be overridden on a per-board basis for future boards if needed. BUG=chrome-os-partner:23247 BRANCH=pit TEST=apshutdown, then hold down a key for 10 seconds. Should not see a watchdog reset. Change-Id: I228f53a32ad4769f6a137a9ab06903111bea115d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/172895 Reviewed-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'include/config.h')
-rw-r--r--include/config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index ce1147a9d6..72dffe49c2 100644
--- a/include/config.h
+++ b/include/config.h
@@ -451,6 +451,13 @@
#undef CONFIG_KEYBOARD_BOARD_CONFIG
/*
+ * Minimum CPU clocks between scans. This ensures that keyboard scanning
+ * doesn't starve the other EC tasks of CPU when running at a decreased system
+ * clock.
+ */
+#undef CONFIG_KEYBOARD_POST_SCAN_CLOCKS
+
+/*
* Call board-supplied keyboard_suppress_noise() function when the debounced
* keyboard state changes. Some boards use this to send a signal to the audio
* codec to suppress typing noise picked up by the microphone.