Skip to contentSkip to conversation

HID: multitouch: Preserve class quirks when inverting orientation

PATCH Applied Muhammed Sariyildiz 2 participants 3 messages Nov 5 – Nov 19 1 message not in the archive HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: multitouch: Preserve class quirks when inverting orientation

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.

---
 drivers/hid/hid-multitouch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +1 -1
index 4e19a0c..94e83fc 100644
@@ -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.
Signature · 1 line
2.47.3
#2 lore raw
In reply to a message not in the archive

Hi Jiri, Benjamin,

Just a gentle ping on this patch.

Thanks,
Muhammed

Asiye Sarıyıldız <[email protected]>, 15 Kas 2026 Paz, 09:01 tarihinde şunu yazdı:

Quoted 39 lines

Hi Jiri, Benjamin,

Just a gentle ping on this patch.

Thanks,
Muhammed

Muhammed Sariyildiz <[email protected]>, 5 Kas 2026 Per, 20:43 tarihinde şunu yazdı:

Quoted 30 lines

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.

---
 drivers/hid/hid-multitouch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +1 -2
index 4e19a0c..94e83fc 100644
@@ -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

maintainer Applied
#3 lore raw
In reply to Muhammed Sariyildiz
Quoted 18 lines · Muhammed Sariyildiz

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.

---
 drivers/hid/hid-multitouch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +0 -0
index 4e19a0c..94e83fc 100644

drivers/hid/hid-multitouch.c static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) · line 2161

Quoted 8 lines
drivers/hid/hid-multitouch.c +1 -1
@@ -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.

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs