Skip to content

Commit 31a4cf1

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent e62b91c commit 31a4cf1

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

drivers/hid/hid-multitouch.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ MODULE_LICENSE("GPL");
7070
#define MT_QUIRK_WIN8_PTP_BUTTONS BIT(18)
7171
#define MT_QUIRK_SEPARATE_APP_REPORT BIT(19)
7272
#define MT_QUIRK_FORCE_MULTI_INPUT BIT(20)
73+
#define MT_QUIRK_DISABLE_WAKEUP BIT(21)
7374

7475
#define MT_INPUTMODE_TOUCHSCREEN 0x02
7576
#define MT_INPUTMODE_TOUCHPAD 0x03
@@ -191,6 +192,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
191192
#define MT_CLS_EXPORT_ALL_INPUTS 0x0013
192193
/* reserved 0x0014 */
193194
#define MT_CLS_WIN_8_FORCE_MULTI_INPUT 0x0015
195+
#define MT_CLS_WIN_8_DISABLE_WAKEUP 0x0016
194196

195197
/* vendor specific classes */
196198
#define MT_CLS_3M 0x0101
@@ -283,6 +285,15 @@ static const struct mt_class mt_classes[] = {
283285
MT_QUIRK_WIN8_PTP_BUTTONS |
284286
MT_QUIRK_FORCE_MULTI_INPUT,
285287
.export_all_inputs = true },
288+
{ .name = MT_CLS_WIN_8_DISABLE_WAKEUP,
289+
.quirks = MT_QUIRK_ALWAYS_VALID |
290+
MT_QUIRK_IGNORE_DUPLICATES |
291+
MT_QUIRK_HOVERING |
292+
MT_QUIRK_CONTACT_CNT_ACCURATE |
293+
MT_QUIRK_STICKY_FINGERS |
294+
MT_QUIRK_WIN8_PTP_BUTTONS |
295+
MT_QUIRK_DISABLE_WAKEUP,
296+
.export_all_inputs = true },
286297

287298
/*
288299
* vendor specific classes
@@ -763,7 +774,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
763774
return 1;
764775
case HID_DG_CONFIDENCE:
765776
if ((cls->name == MT_CLS_WIN_8 ||
766-
cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT) &&
777+
cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT ||
778+
cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP) &&
767779
(field->application == HID_DG_TOUCHPAD ||
768780
field->application == HID_DG_TOUCHSCREEN))
769781
app->quirks |= MT_QUIRK_CONFIDENCE;
@@ -1753,8 +1765,14 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
17531765
#ifdef CONFIG_PM
17541766
static int mt_suspend(struct hid_device *hdev, pm_message_t state)
17551767
{
1768+
struct mt_device *td = hid_get_drvdata(hdev);
1769+
17561770
/* High latency is desirable for power savings during S3/S0ix */
1757-
mt_set_modes(hdev, HID_LATENCY_HIGH, true, true);
1771+
if (td->mtclass.quirks & MT_QUIRK_DISABLE_WAKEUP)
1772+
mt_set_modes(hdev, HID_LATENCY_HIGH, false, false);
1773+
else
1774+
mt_set_modes(hdev, HID_LATENCY_HIGH, true, true);
1775+
17581776
return 0;
17591777
}
17601778

@@ -1813,6 +1831,12 @@ static const struct hid_device_id mt_devices[] = {
18131831
MT_USB_DEVICE(USB_VENDOR_ID_ANTON,
18141832
USB_DEVICE_ID_ANTON_TOUCH_PAD) },
18151833

1834+
/* Asus T101HA */
1835+
{ .driver_data = MT_CLS_WIN_8_DISABLE_WAKEUP,
1836+
HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8,
1837+
USB_VENDOR_ID_ASUSTEK,
1838+
USB_DEVICE_ID_ASUSTEK_T101HA_KEYBOARD) },
1839+
18161840
/* Asus T304UA */
18171841
{ .driver_data = MT_CLS_ASUS,
18181842
HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8,

0 commit comments

Comments
 (0)