[PATCH] HID: multitouch: Preserve class quirks when inverting orientation

From: Muhammed Sariyildiz

Date: Thu Nov 05 2026 - 12:46:13 EST


When exactly one coordinate axis is inverted, mt_probe() replaces the
device class quirks with MT_QUIRK_ORIENTATION_INVERT. This drops all
quirks selected for the device class. Applications created later
inherit the truncated quirk mask, which can break device-specific
contact handling.

Add the orientation quirk instead of replacing the existing mask.

Signed-off-by: Muhammed Sariyildiz <asiyee994@xxxxxxxxx>
---
drivers/hid/hid-multitouch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 4e19a0c..94e83fc 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -2155,7 +2155,7 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (hdev->quirks & (HID_QUIRK_X_INVERT | HID_QUIRK_Y_INVERT) &&
!((hdev->quirks & HID_QUIRK_X_INVERT)
&& (hdev->quirks & HID_QUIRK_Y_INVERT)))
- td->mtclass.quirks = MT_QUIRK_ORIENTATION_INVERT;
+ td->mtclass.quirks |= MT_QUIRK_ORIENTATION_INVERT;

/* This allows the driver to correctly support devices
* that emit events over several HID messages.
--
2.47.3