diff options
author | Simon Glass <sjg@chromium.org> | 2012-10-10 09:42:06 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-10-16 10:46:50 -0700 |
commit | 943c2415450a56c73d965c64f18a68967ea15d5b (patch) | |
tree | c4985efc0722afd7ecc4e969c16edffa2ffefcec | |
parent | aadfab96c0ccff88aefc161d07537604c9be4ba1 (diff) | |
download | chrome-ec-943c2415450a56c73d965c64f18a68967ea15d5b.tar.gz |
Add EC keyscan test interface
Add EC commands for managing a list of keyscan events which the EC
should replay instead of its normal key scanning operation.
There are two commands: one adds to the list of events. The other
allows the list to be cleared, the sequence to be started, and the
resulting information to be collected.
BUG=chrome-os-partner:12179
BRANCH=none
TEST=manual for now:
On snow:
./ectool keyscan 10000 key_sequence.txt
See that the test passes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ie4c3e4d0f5c1dbf642185fec99b9201d47532ae1
Reviewed-on: https://gerrit.chromium.org/gerrit/35117
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | include/ec_commands.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 7577169fc3..477e48fab0 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -190,6 +190,7 @@ enum ec_status { EC_RES_IN_PROGRESS = 8, /* Accepted, command in progress */ EC_RES_UNAVAILABLE = 9, /* No response available */ EC_RES_TIMEOUT = 10, /* We got a timeout */ + EC_RES_OVERFLOW = 11, /* Table / data overflow */ }; /* @@ -989,6 +990,63 @@ struct ec_response_mkbp_get_config { struct ec_mkbp_config config; } __packed; +/* Run the key scan emulation */ +#define EC_CMD_KEYSCAN_SEQ_CTRL 0x66 + +enum ec_keyscan_seq_cmd { + EC_KEYSCAN_SEQ_STATUS = 0, /* Get status information */ + EC_KEYSCAN_SEQ_CLEAR = 1, /* Clear sequence */ + EC_KEYSCAN_SEQ_ADD = 2, /* Add item to sequence */ + EC_KEYSCAN_SEQ_START = 3, /* Start running sequence */ + EC_KEYSCAN_SEQ_COLLECT = 4, /* Collect sequence summary data */ +}; + +enum ec_collect_flags { + /* + * Indicates this scan was processed by the EC. Due to timing, some + * scans may be skipped. + */ + EC_KEYSCAN_SEQ_FLAG_DONE = 1 << 0, +}; + +struct ec_collect_item { + uint8_t flags; /* some flags (enum ec_collect_flags) */ +}; + +struct ec_params_keyscan_seq_ctrl { + uint8_t cmd; /* Command to send (enum ec_keyscan_seq_cmd) */ + union { + struct { + uint8_t active; /* still active */ + uint8_t num_items; /* number of items */ + /* Current item being presented */ + uint8_t cur_item; + } status; + struct { + /* + * Absolute time for this scan, measured from the + * start of the sequence. + */ + uint32_t time_us; + uint8_t scan[0]; /* keyscan data */ + } add; + struct { + uint8_t start_item; /* First item to return */ + uint8_t num_items; /* Number of items to return */ + } collect; + }; +} __packed; + +struct ec_result_keyscan_seq_ctrl { + union { + struct { + uint8_t num_items; /* Number of items */ + /* Data for each item */ + struct ec_collect_item item[0]; + } collect; + }; +} __packed; + /*****************************************************************************/ /* Temperature sensor commands */ |