summaryrefslogtreecommitdiff
path: root/include/update_fw.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2017-11-09 16:35:53 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-14 03:22:31 -0800
commit7fdcb8bf869b59396b8e2c0844c31fefd4c22500 (patch)
tree40ca79851751dfadde6bbf0ab747073b7fba4cc3 /include/update_fw.h
parentb3c99868026675a619ba1d323bc06ea2b5141674 (diff)
downloadchrome-ec-7fdcb8bf869b59396b8e2c0844c31fefd4c22500.tar.gz
usb_update: Add support for touchpad debugging feature
We support touchpad-specific debugging feature over the USB update protocol. This will be used to fetch raw data from the sensor, without requiring to remove the write-protect screw. BRANCH=none BUG=b:63993891 TEST=./usb_updater2 -g 00 -d 18d1:502b Change-Id: I46dfd97aaa17b73a5893fe1e8c62327a302f829b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/763574 Reviewed-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/update_fw.h')
-rw-r--r--include/update_fw.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/update_fw.h b/include/update_fw.h
index f31549e252..727a3012f5 100644
--- a/include/update_fw.h
+++ b/include/update_fw.h
@@ -165,6 +165,7 @@ enum update_extra_command {
UPDATE_EXTRA_CMD_INJECT_ENTROPY = 5,
UPDATE_EXTRA_CMD_PAIR_CHALLENGE = 6,
UPDATE_EXTRA_CMD_TOUCHPAD_INFO = 7,
+ UPDATE_EXTRA_CMD_TOUCHPAD_DEBUG = 8,
};
/*
@@ -247,6 +248,23 @@ int touchpad_get_info(struct touchpad_info *tp);
/* Touchpad FW update: Write a FW block. */
int touchpad_update_write(int offset, int size, const uint8_t *data);
+/**
+ * Touchpad debugging interface, called whenever UPDATE_EXTRA_CMD_TOUCHPAD_DEBUG
+ * is received. Behaviour is touchpad-vendor dependent, with the following
+ * restrictions: data must be allocated statically, and must not be larger than
+ * 64 bytes.
+ *
+ * @param param Data passed as parameter to command.
+ * @param param_size Number of bytes passed as parameter.
+ * @param data Data to write back to host, needs to be allocated
+ * statically by touchpad handler.
+ * @param data_size Amount of data to write back to host (up to 64 bytes).
+ *
+ * @return EC_RES_SUCCESS on success, any other EC_RES_* status on error.
+ */
+int touchpad_debug(const uint8_t *param, unsigned int param_size,
+ uint8_t **data, unsigned int *data_size);
+
/* SHA256 hash of the touchpad firmware expected by this image. */
extern const uint8_t touchpad_fw_full_hash[32];