summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorHarry Cutts <hcutts@chromium.org>2019-09-04 13:49:50 -0700
committerCommit Bot <commit-bot@chromium.org>2019-09-18 01:24:36 +0000
commit73f6dc7cc71d98789f96f38fc8b636d78ba1e9b4 (patch)
tree4c96040cd5869ecc1067724d9ffe0e46b1ce8985 /include/common.h
parent9b659a2c48702bcd2e7658878203cbad7fe71ca4 (diff)
downloadchrome-ec-73f6dc7cc71d98789f96f38fc8b636d78ba1e9b4.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. BRANCH=none 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>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index 37d6db9fb8..7bf4b39215 100644
--- a/include/common.h
+++ b/include/common.h
@@ -127,6 +127,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)