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:33:20 +0000 (09:33 +0100)
commitf380b1060ab08572fba26db63564a52f3199cf9d
tree7a6dbce930d54bbfbd302280805b9b936286f794
parentbe2876e01ad6a9c66b930eb074cf46c66f725644
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