HID: multitouch: Add quirks for flipped axes
authorAllen Ballway <ballway@chromium.org>
Tue, 10 Jan 2023 20:25:50 +0000 (20:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:28 +0000 (09:39 +0100)
commit2098a330b2a6467092f7e5c970dc8ff90222587b
tree6183aacd6e58d328a472460eb65e89fc63b6f3b9
parentf6e9b77257c1479154ac55be587716d7294a9e97
HID: multitouch: Add quirks for flipped axes

[ Upstream commit a2f416bf062a38bb76cccd526d2d286b8e4db4d9 ]

Certain touchscreen devices, such as the ELAN9034, are oriented
incorrectly and report touches on opposite points on the X and Y axes.
For example, a 100x200 screen touched at (10,20) would report (90, 180)
and vice versa.

This is fixed by adding device quirks to transform the touch points
into the correct spaces, from X -> MAX(X) - X, and Y -> MAX(Y) - Y.

Signed-off-by: Allen Ballway <ballway@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Stable-dep-of: 03a86105556e ("HID: retain initial quirks set up when creating HID devices")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-multitouch.c
drivers/hid/hid-quirks.c
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c
drivers/hid/i2c-hid/i2c-hid.h