Skip to contentSkip to conversation

hid/hid-multitouch: Keep latency normal on deactivate for reactivation gesture

PATCH Superseded Werner Sembach 3 participants 6 messages Nov 12, 2025 – Jan 8 HID

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 hid/hid-multitouch: Keep latency normal on deactivate for reactivation gesture

Uniwill devices have a built in gesture in the touchpad to de- and reactivate it by double taping the upper left corner. This gesture stops working when latency is set to high, so this patch keeps the latency on normal.

---
V1->V2: Use a quirk to narrow down the devices this is applied to. V2->V3: Fix this patch breaking touchpads on some devices.
Add another device ID.

I have three Uniwill devices at hand right now that have at least two physically different touchpads, but same Vendor + Product ID combination. Maybe the vendor uses this product ID for all i2c connected touchpads, or it is used as some kind of subvendor ID to indicate Uniwill?

To be able to really narrow it down to Uniwill only devices I would need to check DMI strings, but then I will probably narrow it down to much as I only know what we at TUXEDO use there.

 drivers/hid/hid-multitouch.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +25 -1
index 179dc316b4b51..ed9eb4e0d5038 100644
@@ -76,6 +76,7 @@ MODULE_LICENSE("GPL");
 #define MT_QUIRK_DISABLE_WAKEUP		BIT(21)
 #define MT_QUIRK_ORIENTATION_INVERT	BIT(22)
 #define MT_QUIRK_APPLE_TOUCHBAR		BIT(23)
+#define MT_QUIRK_KEEP_LATENCY_ON_CLOSE	BIT(24)
 
 #define MT_INPUTMODE_TOUCHSCREEN	0x02
 #define MT_INPUTMODE_TOUCHPAD		0x03
@@ -211,6 +212,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
 #define MT_CLS_WIN_8_DISABLE_WAKEUP		0x0016
 #define MT_CLS_WIN_8_NO_STICKY_FINGERS		0x0017
 #define MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU	0x0018
+#define MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE	0x0019
 
 /* vendor specific classes */
 #define MT_CLS_3M				0x0101
@@ -330,6 +332,15 @@ static const struct mt_class mt_classes[] = {
 			MT_QUIRK_CONTACT_CNT_ACCURATE |
 			MT_QUIRK_WIN8_PTP_BUTTONS,
 		.export_all_inputs = true },
+	{ .name = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+		.quirks = MT_QUIRK_ALWAYS_VALID |
+			MT_QUIRK_IGNORE_DUPLICATES |
+			MT_QUIRK_HOVERING |
+			MT_QUIRK_CONTACT_CNT_ACCURATE |
+			MT_QUIRK_STICKY_FINGERS |
+			MT_QUIRK_WIN8_PTP_BUTTONS |
+			MT_QUIRK_KEEP_LATENCY_ON_CLOSE,
+		.export_all_inputs = true },
 
 	/*
 	 * vendor specific classes
@@ -1998,7 +2009,12 @@ static void mt_on_hid_hw_open(struct hid_device *hdev)
 
 static void mt_on_hid_hw_close(struct hid_device *hdev)
 {
-	mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
+	struct mt_device *td = hid_get_drvdata(hdev);
+
+	if (td->mtclass.quirks & MT_QUIRK_KEEP_LATENCY_ON_CLOSE)
+		mt_set_modes(hdev, HID_LATENCY_NORMAL, TOUCHPAD_REPORT_NONE);
+	else
+		mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
 }
 
 /*
@@ -2375,6 +2391,14 @@ static const struct hid_device_id mt_devices[] = {
 		MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
 			USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
 
+	/* Uniwill touchpads */
+	{ .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+		HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
+			USB_VENDOR_ID_PIXART, 0x0255) },
+	{ .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+		HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
+			USB_VENDOR_ID_PIXART, 0x0274) },
+
 	/* VTL panels */
 	{ .driver_data = MT_CLS_VTL,
 		MT_USB_DEVICE(USB_VENDOR_ID_VTL,
Signature · 1 line
2.43.0
#1 lore raw

Am 12.11.25 um 15:47 schrieb Werner Sembach:

Quoted 37 lines

Uniwill devices have a built in gesture in the touchpad to de- and reactivate it by double taping the upper left corner. This gesture stops working when latency is set to high, so this patch keeps the latency on normal.

---
V1->V2: Use a quirk to narrow down the devices this is applied to. V2->V3: Fix this patch breaking touchpads on some devices.
Add another device ID.

I have three Uniwill devices at hand right now that have at least two physically different touchpads, but same Vendor + Product ID combination. Maybe the vendor uses this product ID for all i2c connected touchpads, or it is used as some kind of subvendor ID to indicate Uniwill?

To be able to really narrow it down to Uniwill only devices I would need to check DMI strings, but then I will probably narrow it down to much as I only know what we at TUXEDO use there.

  drivers/hid/hid-multitouch.c | 26 +++++++++++++++++++++++++-
  1 file changed, 25 insertions(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +1 -0
index 179dc316b4b51..ed9eb4e0d5038 100644
@@ -76,6 +76,7 @@ MODULE_LICENSE("GPL");
  #define MT_QUIRK_DISABLE_WAKEUP		BIT(21)
  #define MT_QUIRK_ORIENTATION_INVERT	BIT(22)
  #define MT_QUIRK_APPLE_TOUCHBAR		BIT(23)
+#define MT_QUIRK_KEEP_LATENCY_ON_CLOSE	BIT(24)
 
  #define MT_INPUTMODE_TOUCHSCREEN	0x02
  #define MT_INPUTMODE_TOUCHPAD		0x03

drivers/hid/hid-multitouch.c static void mt_post_parse(struct mt_device *td, struct mt_application *app); · line 215

Quoted 4 lines
drivers/hid/hid-multitouch.c +1 -0
@@ -211,6 +212,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
  #define MT_CLS_WIN_8_DISABLE_WAKEUP		0x0016
  #define MT_CLS_WIN_8_NO_STICKY_FINGERS		0x0017
  #define MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU	0x0018
+#define MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE	0x0019

A college realized that at some points in the code some, but not all, of the MT_CLS_WIN_8* classes are checked for directly. Should I add my new class there too?

Quoted 48 lines
drivers/hid/hid-multitouch.c +23 -1
  /* vendor specific classes */
  #define MT_CLS_3M				0x0101
@@ -330,6 +332,15 @@ static const struct mt_class mt_classes[] = {
  			MT_QUIRK_CONTACT_CNT_ACCURATE |
  			MT_QUIRK_WIN8_PTP_BUTTONS,
  		.export_all_inputs = true },
+	{ .name = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+		.quirks = MT_QUIRK_ALWAYS_VALID |
+			MT_QUIRK_IGNORE_DUPLICATES |
+			MT_QUIRK_HOVERING |
+			MT_QUIRK_CONTACT_CNT_ACCURATE |
+			MT_QUIRK_STICKY_FINGERS |
+			MT_QUIRK_WIN8_PTP_BUTTONS |
+			MT_QUIRK_KEEP_LATENCY_ON_CLOSE,
+		.export_all_inputs = true },
 
  	/*
  	 * vendor specific classes
@@ -1998,7 +2009,12 @@ static void mt_on_hid_hw_open(struct hid_device *hdev)
 
  static void mt_on_hid_hw_close(struct hid_device *hdev)
  {
-	mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
+	struct mt_device *td = hid_get_drvdata(hdev);
+
+	if (td->mtclass.quirks & MT_QUIRK_KEEP_LATENCY_ON_CLOSE)
+		mt_set_modes(hdev, HID_LATENCY_NORMAL, TOUCHPAD_REPORT_NONE);
+	else
+		mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
  }
 
  /*
@@ -2375,6 +2391,14 @@ static const struct hid_device_id mt_devices[] = {
  		MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
  			USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
 
+	/* Uniwill touchpads */
+	{ .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+		HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
+			USB_VENDOR_ID_PIXART, 0x0255) },
+	{ .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+		HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
+			USB_VENDOR_ID_PIXART, 0x0274) },
+
  	/* VTL panels */
  	{ .driver_data = MT_CLS_VTL,
  		MT_USB_DEVICE(USB_VENDOR_ID_VTL,
#2 lore raw

Hi,

Am 12.11.25 um 16:51 schrieb Werner Sembach:

Quoted 6 lines

Am 12.11.25 um 15:47 schrieb Werner Sembach:

Quoted 4 lines

Uniwill devices have a built in gesture in the touchpad to de- and reactivate it by double taping the upper left corner. This gesture stops working when latency is set to high, so this patch keeps the latency on normal.

Just wanna make sure this doesn't get missed for the 6.19 cycle.

Quoted 81 lines
Quoted 32 lines

---
V1->V2: Use a quirk to narrow down the devices this is applied to. V2->V3: Fix this patch breaking touchpads on some devices. Add another device ID.

I have three Uniwill devices at hand right now that have at least two physically different touchpads, but same Vendor + Product ID combination. Maybe the vendor uses this product ID for all i2c connected touchpads, or it is used as some kind of subvendor ID to indicate Uniwill?

To be able to really narrow it down to Uniwill only devices I would need to check DMI strings, but then I will probably narrow it down to much as I only know what we at TUXEDO use there.

  drivers/hid/hid-multitouch.c | 26 +++++++++++++++++++++++++-

  1 file changed, 25 insertions(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +1 -0
index 179dc316b4b51..ed9eb4e0d5038 100644
@@ -76,6 +76,7 @@ MODULE_LICENSE("GPL");
   #define MT_QUIRK_DISABLE_WAKEUP        BIT(21)
   #define MT_QUIRK_ORIENTATION_INVERT    BIT(22)
   #define MT_QUIRK_APPLE_TOUCHBAR        BIT(23)
+#define MT_QUIRK_KEEP_LATENCY_ON_CLOSE    BIT(24)
     #define MT_INPUTMODE_TOUCHSCREEN    0x02
   #define MT_INPUTMODE_TOUCHPAD        0x03

drivers/hid/hid-multitouch.c static void mt_post_parse(struct mt_device *td, struct · line 216

Quoted 5 lines
drivers/hid/hid-multitouch.c +1 -0
@@ -211,6 +212,7 @@ static void mt_post_parse(struct mt_device *td, struct 
 mt_application *app);
   #define MT_CLS_WIN_8_DISABLE_WAKEUP        0x0016
   #define MT_CLS_WIN_8_NO_STICKY_FINGERS        0x0017
   #define MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU    0x0018
+#define MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE    0x0019

A college realized that at some points in the code some, but not all, of the MT_CLS_WIN_8* classes are checked for directly. Should I add my new class there too?

Quoted 43 lines
drivers/hid/hid-multitouch.c +0 -0
     /* vendor specific classes */
   #define MT_CLS_3M                0x0101
@@ -330,6 +332,15 @@ static const struct mt_class mt_classes[] = {

              MT_QUIRK_CONTACT_CNT_ACCURATE | MT_QUIRK_WIN8_PTP_BUTTONS, .export_all_inputs = true },
+    { .name = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE, +        .quirks = MT_QUIRK_ALWAYS_VALID | +            MT_QUIRK_IGNORE_DUPLICATES | +            MT_QUIRK_HOVERING |
+            MT_QUIRK_CONTACT_CNT_ACCURATE | +            MT_QUIRK_STICKY_FINGERS |
+            MT_QUIRK_WIN8_PTP_BUTTONS |
+            MT_QUIRK_KEEP_LATENCY_ON_CLOSE, +        .export_all_inputs = true },
        /*
       * vendor specific classes

drivers/hid/hid-multitouch.c +6 -1
@@ -1998,7 +2009,12 @@ static void mt_on_hid_hw_open(struct hid_device *hdev)
     static void mt_on_hid_hw_close(struct hid_device *hdev)
   {
-    mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
+    struct mt_device *td = hid_get_drvdata(hdev);
+
+    if (td->mtclass.quirks & MT_QUIRK_KEEP_LATENCY_ON_CLOSE)
+        mt_set_modes(hdev, HID_LATENCY_NORMAL, TOUCHPAD_REPORT_NONE);
+    else
+        mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
   }
     /*
@@ -2375,6 +2391,14 @@ static const struct hid_device_id mt_devices[] = {
           MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
               USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },

  +    /* Uniwill touchpads */
+    { .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE, +        HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, +            USB_VENDOR_ID_PIXART, 0x0255) },
+    { .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE, +        HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, +            USB_VENDOR_ID_PIXART, 0x0274) },
+
      /* VTL panels */
      { .driver_data = MT_CLS_VTL, MT_USB_DEVICE(USB_VENDOR_ID_VTL,

maintainer
#3 lore raw
Quoted 5 lines · Werner Sembach
Quoted 4 lines
Quoted 4 lines

Uniwill devices have a built in gesture in the touchpad to de- and reactivate it by double taping the upper left corner. This gesture stops working when latency is set to high, so this patch keeps the latency on normal.

Just wanna make sure this doesn't get missed for the 6.19 cycle.

According to my notes, the last thing you said on the v3 discussion with Benjamin was "v4 incoming", so I did put this on backburner until I see v4 ... has anything changed there?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#4 lore raw
In reply to Werner Sembach
Quoted 37 lines · Werner Sembach

Am 12.11.25 um 15:47 schrieb Werner Sembach:

Quoted 35 lines

Uniwill devices have a built in gesture in the touchpad to de- and reactivate it by double taping the upper left corner. This gesture stops working when latency is set to high, so this patch keeps the latency on normal.

---
V1->V2: Use a quirk to narrow down the devices this is applied to. V2->V3: Fix this patch breaking touchpads on some devices.
Add another device ID.

I have three Uniwill devices at hand right now that have at least two physically different touchpads, but same Vendor + Product ID combination. Maybe the vendor uses this product ID for all i2c connected touchpads, or it is used as some kind of subvendor ID to indicate Uniwill?

To be able to really narrow it down to Uniwill only devices I would need to check DMI strings, but then I will probably narrow it down to much as I only know what we at TUXEDO use there.

  drivers/hid/hid-multitouch.c | 26 +++++++++++++++++++++++++-
  1 file changed, 25 insertions(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +1 -0
index 179dc316b4b51..ed9eb4e0d5038 100644
@@ -76,6 +76,7 @@ MODULE_LICENSE("GPL");
  #define MT_QUIRK_DISABLE_WAKEUP		BIT(21)
  #define MT_QUIRK_ORIENTATION_INVERT	BIT(22)
  #define MT_QUIRK_APPLE_TOUCHBAR		BIT(23)
+#define MT_QUIRK_KEEP_LATENCY_ON_CLOSE	BIT(24)
  #define MT_INPUTMODE_TOUCHSCREEN	0x02
  #define MT_INPUTMODE_TOUCHPAD		0x03
Quoted 8 lines

drivers/hid/hid-multitouch.c static void mt_post_parse(struct mt_device *td, struct mt_application *app); · line 215

Quoted 5 lines
drivers/hid/hid-multitouch.c +1 -0
@@ -211,6 +212,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
  #define MT_CLS_WIN_8_DISABLE_WAKEUP		0x0016
  #define MT_CLS_WIN_8_NO_STICKY_FINGERS		0x0017
  #define MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU	0x0018
+#define MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE	0x0019

A college realized that at some points in the code some, but not all, of the MT_CLS_WIN_8* classes are checked for directly. Should I add my new class there too?

It depends. If it's truely a WIN_8 touchpad then I guess those checks are here for a reason, but if this particular device works without them, then it's your call in the end.

Cheers,
Benjamin

#5 lore raw

Am 19.12.25 um 14:10 schrieb Benjamin Tissoires:

Quoted 45 lines · Werner Sembach
Quoted 36 lines

Am 12.11.25 um 15:47 schrieb Werner Sembach:

Quoted 35 lines

Uniwill devices have a built in gesture in the touchpad to de- and reactivate it by double taping the upper left corner. This gesture stops working when latency is set to high, so this patch keeps the latency on normal.

---
V1->V2: Use a quirk to narrow down the devices this is applied to. V2->V3: Fix this patch breaking touchpads on some devices.
Add another device ID.

I have three Uniwill devices at hand right now that have at least two physically different touchpads, but same Vendor + Product ID combination. Maybe the vendor uses this product ID for all i2c connected touchpads, or it is used as some kind of subvendor ID to indicate Uniwill?

To be able to really narrow it down to Uniwill only devices I would need to check DMI strings, but then I will probably narrow it down to much as I only know what we at TUXEDO use there.

   drivers/hid/hid-multitouch.c | 26 +++++++++++++++++++++++++-
   1 file changed, 25 insertions(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +1 -0
index 179dc316b4b51..ed9eb4e0d5038 100644
@@ -76,6 +76,7 @@ MODULE_LICENSE("GPL");
   #define MT_QUIRK_DISABLE_WAKEUP		BIT(21)
   #define MT_QUIRK_ORIENTATION_INVERT	BIT(22)
   #define MT_QUIRK_APPLE_TOUCHBAR		BIT(23)
+#define MT_QUIRK_KEEP_LATENCY_ON_CLOSE	BIT(24)
   #define MT_INPUTMODE_TOUCHSCREEN	0x02
   #define MT_INPUTMODE_TOUCHPAD		0x03
Quoted 8 lines

drivers/hid/hid-multitouch.c static void mt_post_parse(struct mt_device *td, struct mt_application *app); · line 215

Quoted 5 lines
drivers/hid/hid-multitouch.c +1 -0
@@ -211,6 +212,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
   #define MT_CLS_WIN_8_DISABLE_WAKEUP		0x0016
   #define MT_CLS_WIN_8_NO_STICKY_FINGERS		0x0017
   #define MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU	0x0018
+#define MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE	0x0019

A college realized that at some points in the code some, but not all, of the MT_CLS_WIN_8* classes are checked for directly. Should I add my new class there too?

Quoted 3 lines

It depends. If it's truely a WIN_8 touchpad then I guess those checks are here for a reason, but if this particular device works without them, then it's your call in the end.

Didn't notice a difference, but will it include anyway to be on the safe side.

v4 incoming

Quoted 3 lines

Cheers,
Benjamin