summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-quirks.c
diff options
context:
space:
mode:
authorAllen Ballway <ballway@chromium.org>2023-01-10 23:25:50 +0300
committerJiri Kosina <jkosina@suse.cz>2023-01-18 12:08:51 +0300
commita2f416bf062a38bb76cccd526d2d286b8e4db4d9 (patch)
tree7420dede600d89baa8f1525fee6cca4c0326c284 /drivers/hid/hid-quirks.c
parentd264dd3bbbd16b56239e889023fbe49413a58eaf (diff)
downloadlinux-a2f416bf062a38bb76cccd526d2d286b8e4db4d9.tar.xz
HID: multitouch: Add quirks for flipped axes
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>
Diffstat (limited to 'drivers/hid/hid-quirks.c')
-rw-r--r--drivers/hid/hid-quirks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 0e9702c7f7d6..78452faf3c9b 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -19,6 +19,7 @@
#include <linux/input/elan-i2c-ids.h>
#include "hid-ids.h"
+#include "i2c-hid/i2c-hid.h"
/*
* Alphabetically sorted by vendor then product.
@@ -1298,6 +1299,11 @@ unsigned long hid_lookup_quirk(const struct hid_device *hdev)
quirks = hid_gets_squirk(hdev);
mutex_unlock(&dquirks_lock);
+ /* Get quirks specific to I2C devices */
+ if (IS_ENABLED(CONFIG_I2C_DMI_CORE) && IS_ENABLED(CONFIG_DMI) &&
+ hdev->bus == BUS_I2C)
+ quirks |= i2c_hid_get_dmi_quirks(hdev->vendor, hdev->product);
+
return quirks;
}
EXPORT_SYMBOL_GPL(hid_lookup_quirk);