Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: multitouch: Disable event reporting on suspend on the Asus T101HA touchpad

The Asus T101HA has a problem with spurious wakeups when the lid is
closed, this is caused by the screen sitting so close to the touchpad
that the touchpad ends up reporting touch events, causing these wakeups.

Add a quirk which disables event reporting on suspend when set, and
enable this quirk for the Asus T101HA touchpad fixing the spurious
wakeups, while still allowing the device to be woken by pressing a
key on the keyboard (which is part of the same USB device).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Hans de Goede and committed by
Jiri Kosina
31a4cf1d e62b91cd

+26 -2
+26 -2
drivers/hid/hid-multitouch.c
··· 70 70 #define MT_QUIRK_WIN8_PTP_BUTTONS BIT(18) 71 71 #define MT_QUIRK_SEPARATE_APP_REPORT BIT(19) 72 72 #define MT_QUIRK_FORCE_MULTI_INPUT BIT(20) 73 + #define MT_QUIRK_DISABLE_WAKEUP BIT(21) 73 74 74 75 #define MT_INPUTMODE_TOUCHSCREEN 0x02 75 76 #define MT_INPUTMODE_TOUCHPAD 0x03 ··· 192 191 #define MT_CLS_EXPORT_ALL_INPUTS 0x0013 193 192 /* reserved 0x0014 */ 194 193 #define MT_CLS_WIN_8_FORCE_MULTI_INPUT 0x0015 194 + #define MT_CLS_WIN_8_DISABLE_WAKEUP 0x0016 195 195 196 196 /* vendor specific classes */ 197 197 #define MT_CLS_3M 0x0101 ··· 284 282 MT_QUIRK_STICKY_FINGERS | 285 283 MT_QUIRK_WIN8_PTP_BUTTONS | 286 284 MT_QUIRK_FORCE_MULTI_INPUT, 285 + .export_all_inputs = true }, 286 + { .name = MT_CLS_WIN_8_DISABLE_WAKEUP, 287 + .quirks = MT_QUIRK_ALWAYS_VALID | 288 + MT_QUIRK_IGNORE_DUPLICATES | 289 + MT_QUIRK_HOVERING | 290 + MT_QUIRK_CONTACT_CNT_ACCURATE | 291 + MT_QUIRK_STICKY_FINGERS | 292 + MT_QUIRK_WIN8_PTP_BUTTONS | 293 + MT_QUIRK_DISABLE_WAKEUP, 287 294 .export_all_inputs = true }, 288 295 289 296 /* ··· 774 763 return 1; 775 764 case HID_DG_CONFIDENCE: 776 765 if ((cls->name == MT_CLS_WIN_8 || 777 - cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT) && 766 + cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT || 767 + cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP) && 778 768 (field->application == HID_DG_TOUCHPAD || 779 769 field->application == HID_DG_TOUCHSCREEN)) 780 770 app->quirks |= MT_QUIRK_CONFIDENCE; ··· 1765 1753 #ifdef CONFIG_PM 1766 1754 static int mt_suspend(struct hid_device *hdev, pm_message_t state) 1767 1755 { 1756 + struct mt_device *td = hid_get_drvdata(hdev); 1757 + 1768 1758 /* High latency is desirable for power savings during S3/S0ix */ 1769 - mt_set_modes(hdev, HID_LATENCY_HIGH, true, true); 1759 + if (td->mtclass.quirks & MT_QUIRK_DISABLE_WAKEUP) 1760 + mt_set_modes(hdev, HID_LATENCY_HIGH, false, false); 1761 + else 1762 + mt_set_modes(hdev, HID_LATENCY_HIGH, true, true); 1763 + 1770 1764 return 0; 1771 1765 } 1772 1766 ··· 1830 1812 { .driver_data = MT_CLS_EXPORT_ALL_INPUTS, 1831 1813 MT_USB_DEVICE(USB_VENDOR_ID_ANTON, 1832 1814 USB_DEVICE_ID_ANTON_TOUCH_PAD) }, 1815 + 1816 + /* Asus T101HA */ 1817 + { .driver_data = MT_CLS_WIN_8_DISABLE_WAKEUP, 1818 + HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8, 1819 + USB_VENDOR_ID_ASUSTEK, 1820 + USB_DEVICE_ID_ASUSTEK_T101HA_KEYBOARD) }, 1833 1821 1834 1822 /* Asus T304UA */ 1835 1823 { .driver_data = MT_CLS_ASUS,