summaryrefslogtreecommitdiff
path: root/include/i2c_hid_touchpad.h
diff options
context:
space:
mode:
authorShecky Lin <sheckylin@chromium.org>2020-03-11 15:30:13 +0800
committerCommit Bot <commit-bot@chromium.org>2020-03-17 12:11:49 +0000
commitaf54ae817e5e070b5cbc0c626013b9fa807bf8d9 (patch)
treec48d966699a3c7cc9fde1cf5e6b2c324a2591fb9 /include/i2c_hid_touchpad.h
parent1499ed62a817db87a6cee635fa3c409b323d6ebf (diff)
downloadchrome-ec-af54ae817e5e070b5cbc0c626013b9fa807bf8d9.tar.gz
i2c_hid_touchpad: Add function to prepare new input reports
This is part of a chain to add a common I2C HID interface for touchpads. The CL adds a function to put a new input report in the buffer which would be sent next time when the host tries to read one. BUG=chromium:1008568 BRANCH=none TEST=Build and run on MCU to forward touchpad events to host through I2C HID. Cq-Depend: chromium:2094928 Change-Id: I321054f73155da03d951a4d586dd316caf37f0fc Signed-off-by: Shecky Lin <sheckylin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094929 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'include/i2c_hid_touchpad.h')
-rw-r--r--include/i2c_hid_touchpad.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/i2c_hid_touchpad.h b/include/i2c_hid_touchpad.h
index 3bb53f4020..d5d728a488 100644
--- a/include/i2c_hid_touchpad.h
+++ b/include/i2c_hid_touchpad.h
@@ -69,5 +69,13 @@ void i2c_hid_touchpad_init(void);
int i2c_hid_touchpad_process(unsigned int len, uint8_t *buffer,
void (*send_response)(int len), uint8_t *data,
int *reg, int *cmd);
+/**
+ * Compile an (outgoing) HID input report for an (incoming) touchpad event
+ *
+ * The compiled report would be sent next time when the host requests one.
+ *
+ * @param touchpad_event Touchpad event data
+ */
+void i2c_hid_compile_report(struct touchpad_event *event);
#endif /* __CROS_EC_I2C_HID_TOUCHPAD_H */