summaryrefslogtreecommitdiff
path: root/util
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 /util
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 'util')
-rw-r--r--util/ectool.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/util/ectool.c b/util/ectool.c
index d21bb99fe5..59793e21d6 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -121,6 +121,8 @@ const char help_str[] =
" Set the delay before going into hibernation\n"
" kbpress\n"
" Simulate key press\n"
+ " kbfactorytest\n"
+ " Scan out keyboard if any pins are shorted\n"
" i2cread\n"
" Read I2C bus\n"
" i2cwrite\n"
@@ -4208,6 +4210,24 @@ int cmd_kbpress(int argc, char *argv[])
return 0;
}
+int cmd_keyboard_factory_test(int argc, char *argv[])
+{
+ struct ec_response_keyboard_factory_test r;
+ int rv;
+
+ rv = ec_command(EC_CMD_KEYBOARD_FACTORY_TEST, 0,
+ NULL, 0, &r, sizeof(r));
+ if (rv < 0)
+ return rv;
+
+ if (r.shorted != 0)
+ printf("Keyboard %d and %d pin are shorted.\n",
+ r.shorted & 0x00ff, r.shorted >> 8);
+ else
+ printf("Keyboard factory test passed.\n");
+
+ return 0;
+}
static void print_panic_reg(int regnum, const uint32_t *regs, int index)
{
@@ -6564,6 +6584,7 @@ const struct command commands[] = {
{"lightbar", cmd_lightbar},
{"keyconfig", cmd_keyconfig},
{"keyscan", cmd_keyscan},
+ {"kbfactorytest", cmd_keyboard_factory_test},
{"motionsense", cmd_motionsense},
{"nextevent", cmd_next_event},
{"panicinfo", cmd_panic_info},