]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Input: zforce_ts - make parsing of contacts less confusing
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 24 Aug 2024 05:50:34 +0000 (22:50 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 6 Sep 2024 05:56:46 +0000 (22:56 -0700)
commit43a48ec581d7e4b6751b236122f7c0a78c99a838
tree2a6186830ccbf2c56232b4cb116d3e03cb70789d
parent83b6549ee18885c1ac74ae91a7e406e7ed33b5c8
Input: zforce_ts - make parsing of contacts less confusing

Zforce touch data packet consists of a byte representing number of
contacts followed by several chunks with length of 9 bytes representing
each contact. Instead of accounting for the leading byte by increasing
offset of each field in contacts by one introduce a pointer to contact
data and point it appropriately. This avoids awkward constructs like:

point.prblty = payload[9 * i + 9];

which makes it seem like there is off-by-one error, in favor of more
straightforward:

point.prblty = p[8];

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/zforce_ts.c