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

HID: multitouch: add support for Win 8.1 multitouch touchpads

Multitouch touchpads built for Win 8.1 need to be sent an input mode feature report
in order to start reporting multitouch events. This is the same process sent
to Win 7 multitouch touchscreens except the value of the feature report is 3 for
touchpads.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Andrew Duggan and committed by
Jiri Kosina
9abebedb 6aef704e

+9 -2
+9 -2
drivers/hid/hid-multitouch.c
··· 68 68 #define MT_QUIRK_HOVERING (1 << 11) 69 69 #define MT_QUIRK_CONTACT_CNT_ACCURATE (1 << 12) 70 70 71 + #define MT_INPUTMODE_TOUCHSCREEN 0x02 72 + #define MT_INPUTMODE_TOUCHPAD 0x03 73 + 71 74 struct mt_slot { 72 75 __s32 x, y, cx, cy, p, w, h; 73 76 __s32 contactid; /* the device ContactID assigned to this slot */ ··· 108 105 __s16 inputmode_index; /* InputMode HID feature index in the report */ 109 106 __s16 maxcontact_report_id; /* Maximum Contact Number HID feature, 110 107 -1 if non-existent */ 108 + __u8 inputmode_value; /* InputMode HID feature value */ 111 109 __u8 num_received; /* how many contacts we received */ 112 110 __u8 num_expected; /* expected last contact index */ 113 111 __u8 maxcontacts; ··· 367 363 * Model touchscreens providing buttons as touchpads. 368 364 */ 369 365 if (field->application == HID_DG_TOUCHPAD || 370 - (usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) 366 + (usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) { 371 367 td->mt_flags |= INPUT_MT_POINTER; 368 + td->inputmode_value = MT_INPUTMODE_TOUCHPAD; 369 + } 372 370 373 371 if (usage->usage_index) 374 372 prev_usage = &field->usage[usage->usage_index - 1]; ··· 816 810 re = &(hdev->report_enum[HID_FEATURE_REPORT]); 817 811 r = re->report_id_hash[td->inputmode]; 818 812 if (r) { 819 - r->field[0]->value[td->inputmode_index] = 0x02; 813 + r->field[0]->value[td->inputmode_index] = td->inputmode_value; 820 814 hid_hw_request(hdev, r, HID_REQ_SET_REPORT); 821 815 } 822 816 } ··· 984 978 td->mtclass = *mtclass; 985 979 td->inputmode = -1; 986 980 td->maxcontact_report_id = -1; 981 + td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN; 987 982 td->cc_index = -1; 988 983 td->mt_report_id = -1; 989 984 hid_set_drvdata(hdev, td);