summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2021-08-29 17:31:05 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-17 00:18:36 +0000
commitc75be20fc37b93839ec2d584bcf7cf41684eabcd (patch)
treeee0624ab2784c69040551f9dc0f4e12b1ee8f351
parentad40e89582369678e9c205b4ba45d480036aa5c6 (diff)
downloadchrome-ec-c75be20fc37b93839ec2d584bcf7cf41684eabcd.tar.gz
touchpad_gt7288: Basic driver for Goodix GT7288
A simple driver which allows touch reports and firmware version information to be read. If the appropriate config flag is set, console commands are included for testing. Unlike the other two touchpad drivers already implemented, which simply receive I2C HID events and send them straight out again over USB HID, we want to do some processing on the touchpad data in the board directory. For that reason, this driver leaves handling the touch interrupts up to the user. Conflict: Just add UINT16_FROM_BYTE_ARRAY_LE macro. BRANCH=rammus BUG=none TEST=With https://crrev.com/c/1716928 patched, run the various host commands and check the output. Change-Id: Ia38e516473b78fb052ae18ca89acc5d815b53bd6 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1799290 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3128749 Reviewed-by: JuHyun Kim <jkim@invensense.com> Tested-by: JuHyun Kim <jkim@invensense.com>
-rw-r--r--include/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index ddd310f5d4..65c4082d53 100644
--- a/include/common.h
+++ b/include/common.h
@@ -124,6 +124,11 @@
#endif
#endif
+/* Macros for combining bytes into uint16s. */
+#define UINT16_FROM_BYTES(lsb, msb) ((lsb) | (msb) << 8)
+#define UINT16_FROM_BYTE_ARRAY_LE(data, lsb_index) \
+ UINT16_FROM_BYTES((data)[(lsb_index)], (data)[(lsb_index + 1)])
+
/* There isn't really a better place for this */
#define C_TO_K(temp_c) ((temp_c) + 273)
#define K_TO_C(temp_c) ((temp_c) - 273)