diff options
author | Nicolas Boichat <drinkcat@google.com> | 2017-07-10 08:24:13 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-08-03 00:32:05 -0700 |
commit | e525e1af8a9d89fe1613238b4a5eb458e7f5c7de (patch) | |
tree | 04690eea15be6fc1de7952d7f803fe6ac20745ed /include | |
parent | 959452ac9744c981dd2c94f4ef680e8ed3df76a0 (diff) | |
download | chrome-ec-e525e1af8a9d89fe1613238b4a5eb458e7f5c7de.tar.gz |
usb_update: Add a way to fetch touchpad information
We'd like to know touchpad vendor/product id, as well as currently
running FW version. This CL does that by adding a new
UPDATE_EXTRA_CMD_TOUCHPAD_INFO command.
We also make the interface more generic by adding a CONFIG_TOUCHPAD
configuration option, even though we only support Elan touchpads
currently.
BRANCH=none
BUG=b:63418037
TEST=Flash hammer, ./usb_updater -t
Change-Id: Icce3c785eb3235bcc50b2ae7c0227ce11cbc9f2b
Signed-off-by: Nicolas Boichat <drinkcat@google.com>
Reviewed-on: https://chromium-review.googlesource.com/593000
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Chun-ta Lin <itspeter@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 3 | ||||
-rw-r--r-- | include/update_fw.h | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h index c241fb2657..04f87de2d4 100644 --- a/include/config.h +++ b/include/config.h @@ -2251,6 +2251,9 @@ /*****************************************************************************/ /* Touchpad config */ +/* Enable touchpad, you must pick a driver (currently, only Elan exists) */ +#undef CONFIG_TOUCHPAD + /* Enable Elan driver */ #undef CONFIG_TOUCHPAD_ELAN diff --git a/include/update_fw.h b/include/update_fw.h index 5218d07bdf..44c64468f6 100644 --- a/include/update_fw.h +++ b/include/update_fw.h @@ -164,6 +164,7 @@ enum update_extra_command { UPDATE_EXTRA_CMD_UNLOCK_ROLLBACK = 4, UPDATE_EXTRA_CMD_INJECT_ENTROPY = 5, UPDATE_EXTRA_CMD_PAIR_CHALLENGE = 6, + UPDATE_EXTRA_CMD_TOUCHPAD_INFO = 7, }; /* @@ -188,6 +189,19 @@ struct pair_challenge_response { uint8_t authenticator[16]; } __packed; +struct touchpad_info { + uint8_t status; /* = EC_RES_SUCCESS */ + uint8_t reserved; /* padding */ + uint16_t vendor; /* Vendor USB id */ + + /* Vendor specific data. */ + struct { + uint16_t id; + uint16_t fw_version; + uint16_t fw_checksum; + } elan; +} __packed; + void fw_update_command_handler(void *body, size_t cmd_size, size_t *response_size); @@ -213,4 +227,7 @@ enum { UPDATE_RWSIG_BUSY = 10, }; +/* Obtain touchpad information */ +int touchpad_get_info(struct touchpad_info *tp); + #endif /* ! __CROS_EC_UPDATE_FW_H */ |