Skip to content

Commit 40d5bb8

Browse files
committed
HID: multitouch: enable multi-input as a quirk for some devices
Two touchpad/trackstick combos are currently not behaving properly. They define a mouse emulation collection, as per Win8 requirements, but also define a separate mouse collection for the trackstick. The way the kernel currently treat the collections is that it merges both in one device. However, given that the first mouse collection already defines X,Y and left, right buttons, when mapping the events from the second mouse collection, hid-multitouch sees that these events are already mapped, and simply ignores them. To be able to report events from the tracktick, add a new quirked class for it, and manually add the 2 devices we know about. Link: https://bugzilla.kernel.org/show_bug.cgi?id=207235 Cc: [email protected] Tested-by: Kai-Heng Feng <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 47cf1b4 commit 40d5bb8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

drivers/hid/hid-multitouch.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ MODULE_LICENSE("GPL");
6969
#define MT_QUIRK_ASUS_CUSTOM_UP BIT(17)
7070
#define MT_QUIRK_WIN8_PTP_BUTTONS BIT(18)
7171
#define MT_QUIRK_SEPARATE_APP_REPORT BIT(19)
72+
#define MT_QUIRK_FORCE_MULTI_INPUT BIT(20)
7273

7374
#define MT_INPUTMODE_TOUCHSCREEN 0x02
7475
#define MT_INPUTMODE_TOUCHPAD 0x03
@@ -189,6 +190,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
189190
#define MT_CLS_WIN_8 0x0012
190191
#define MT_CLS_EXPORT_ALL_INPUTS 0x0013
191192
#define MT_CLS_WIN_8_DUAL 0x0014
193+
#define MT_CLS_WIN_8_FORCE_MULTI_INPUT 0x0015
192194

193195
/* vendor specific classes */
194196
#define MT_CLS_3M 0x0101
@@ -279,6 +281,15 @@ static const struct mt_class mt_classes[] = {
279281
MT_QUIRK_CONTACT_CNT_ACCURATE |
280282
MT_QUIRK_WIN8_PTP_BUTTONS,
281283
.export_all_inputs = true },
284+
{ .name = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
285+
.quirks = MT_QUIRK_ALWAYS_VALID |
286+
MT_QUIRK_IGNORE_DUPLICATES |
287+
MT_QUIRK_HOVERING |
288+
MT_QUIRK_CONTACT_CNT_ACCURATE |
289+
MT_QUIRK_STICKY_FINGERS |
290+
MT_QUIRK_WIN8_PTP_BUTTONS |
291+
MT_QUIRK_FORCE_MULTI_INPUT,
292+
.export_all_inputs = true },
282293

283294
/*
284295
* vendor specific classes
@@ -1714,6 +1725,11 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
17141725
if (id->group != HID_GROUP_MULTITOUCH_WIN_8)
17151726
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
17161727

1728+
if (mtclass->quirks & MT_QUIRK_FORCE_MULTI_INPUT) {
1729+
hdev->quirks &= ~HID_QUIRK_INPUT_PER_APP;
1730+
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
1731+
}
1732+
17171733
timer_setup(&td->release_timer, mt_expired_timeout, 0);
17181734

17191735
ret = hid_parse(hdev);
@@ -1926,6 +1942,11 @@ static const struct hid_device_id mt_devices[] = {
19261942
MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
19271943
USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002) },
19281944

1945+
/* Elan devices */
1946+
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
1947+
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
1948+
USB_VENDOR_ID_ELAN, 0x313a) },
1949+
19291950
/* Elitegroup panel */
19301951
{ .driver_data = MT_CLS_SERIAL,
19311952
MT_USB_DEVICE(USB_VENDOR_ID_ELITEGROUP,
@@ -2056,6 +2077,11 @@ static const struct hid_device_id mt_devices[] = {
20562077
MT_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM,
20572078
USB_DEVICE_ID_MTP_STM)},
20582079

2080+
/* Synaptics devices */
2081+
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
2082+
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
2083+
USB_VENDOR_ID_SYNAPTICS, 0xce08) },
2084+
20592085
/* TopSeed panels */
20602086
{ .driver_data = MT_CLS_TOPSEED,
20612087
MT_USB_DEVICE(USB_VENDOR_ID_TOPSEED2,

0 commit comments

Comments
 (0)