summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDevn Lu <Devin.lu@quantatw.com>2016-03-14 15:23:05 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-04-01 00:21:35 -0700
commit93be0c3b0ac3ed49d7d1d99c5ace8cd0487de7f5 (patch)
treed1862b3dbd160bd2983f1a966047c5830d0f7346 /include
parent55cd6e4c75895c5727ea6fd87b047a39a8730490 (diff)
downloadchrome-ec-93be0c3b0ac3ed49d7d1d99c5ace8cd0487de7f5.tar.gz
ectool: Support keyboard factory scanning
This is keyboard test mechanism request for "multiple key press test", we can thru the testing to scan out kso ksi pins shortting or keyboard has multiple key pressing, below was the testing steps: 1. Turn off internal keyboard scan function. 2. Set all scan & sense pins to input and internal push up. 3. Set start one pin to output low. 4. check other pins status if any sense low level. 5. repeat step 3~4 for all keyboard KSO/KSI pins. 6. Turn on internal keyboard scan function. BUG=chrome-os-partner:49235 BRANCH=ToT TEST=manual Short any KSO or KSI pins and excute "ectool kbfactorytest", it shows failed. if no pins short together, it shows passed. Change-Id: Id2c4310d45e892aebc6d2c0795db22eba5a30641 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/332322 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h3
-rw-r--r--include/ec_commands.h7
-rw-r--r--include/keyboard_raw.h7
3 files changed, 17 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index a126055be8..28363da4eb 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1209,6 +1209,9 @@
/* Compile code for MKBP keyboard protocol */
#undef CONFIG_KEYBOARD_PROTOCOL_MKBP
+/* Support keyboard factory test scanning */
+#undef CONFIG_KEYBOARD_FACTORY_TEST
+
/*
* Keyboard config (struct keyboard_scan_config) is in board.c. If this is
* not defined, default values from common/keyboard_scan.c will be used.
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 9434a5df45..a205878bec 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -2481,6 +2481,13 @@ struct ec_response_get_next_event {
union ec_response_get_next_data data;
} __packed;
+/* Run keyboard factory test scanning */
+#define EC_CMD_KEYBOARD_FACTORY_TEST 0x68
+
+struct ec_response_keyboard_factory_test {
+ uint16_t shorted; /* Keyboard pins are shorted */
+} __packed;
+
/*****************************************************************************/
/* Temperature sensor commands */
diff --git a/include/keyboard_raw.h b/include/keyboard_raw.h
index 8591700b47..db13852635 100644
--- a/include/keyboard_raw.h
+++ b/include/keyboard_raw.h
@@ -71,4 +71,11 @@ void keyboard_raw_gpio_interrupt(enum gpio_signal signal);
static inline void keyboard_raw_gpio_interrupt(enum gpio_signal signal) { }
#endif /* !HAS_TASK_KEYSCAN */
+/**
+ * Run keyboard factory test scanning.
+ *
+ * @return non-zero if keyboard pins are shorted.
+ */
+int keyboard_factory_test_scan(void);
+
#endif /* __CROS_EC_KEYBOARD_RAW_H */