Input: iqs5xx - simplify axis setup logic
authorJeff LaBundy <jeff@labundy.com>
Mon, 25 Jan 2021 04:33:37 +0000 (20:33 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 25 Jan 2021 04:49:07 +0000 (20:49 -0800)
commit4a76d861d9182f2edfab96e7aa1f1e10f4f86bc0
tree0180ece8007297c33528c7879a7f75a6ec321f9f
parente10ba0d3c042161a26311d43bd37c3634d7bc5ca
Input: iqs5xx - simplify axis setup logic

The present implementation manipulates axis swap and inversion fields
in the device to more or less duplicate what touchscreen_report_pos()
does. The resulting logic is convoluted and difficult to follow.

Instead report the maximum X and Y coordinates in earnest as they are
read from the device, then let touchscreen_parse_properties() fix the
axes up as necessary. Finally, use touchscreen_report_pos() to report
the transformed coordinates.

Last but not least, the maximum X and Y coordinates are not functions
of the number of rows/columns that comprise the touch surface. Either
coordinate is simply limited to 1 below what is reported for absolute
X or Y coordinates when no fingers are present (0xFFFF).

Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/1611002626-5889-7-git-send-email-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/iqs5xx.c