HID: core: fix grouping by application
commit f07b3c1da9
("HID: generic: create one input report per
application type") was effectively the same as MULTI_INPUT:
hidinput->report was never set, so hidinput_match_application()
always returned null.
Fix that by testing against the real application.
Note that this breaks some old eGalax touchscreens that expect MULTI_INPUT
instead of HID_QUIRK_INPUT_PER_APP. Enable this quirk for backward
compatibility on all non-Win8 touchscreens.
link: https://bugzilla.kernel.org/show_bug.cgi?id=200847
link: https://bugzilla.kernel.org/show_bug.cgi?id=200849
link: https://bugs.archlinux.org/task/59699
link: https://github.com/NixOS/nixpkgs/issues/45165
Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
ec6adef5fb
commit
0d6c301140
|
@ -1582,6 +1582,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
|
||||||
input_dev->dev.parent = &hid->dev;
|
input_dev->dev.parent = &hid->dev;
|
||||||
|
|
||||||
hidinput->input = input_dev;
|
hidinput->input = input_dev;
|
||||||
|
hidinput->application = application;
|
||||||
list_add_tail(&hidinput->list, &hid->inputs);
|
list_add_tail(&hidinput->list, &hid->inputs);
|
||||||
|
|
||||||
INIT_LIST_HEAD(&hidinput->reports);
|
INIT_LIST_HEAD(&hidinput->reports);
|
||||||
|
@ -1677,8 +1678,7 @@ static struct hid_input *hidinput_match_application(struct hid_report *report)
|
||||||
struct hid_input *hidinput;
|
struct hid_input *hidinput;
|
||||||
|
|
||||||
list_for_each_entry(hidinput, &hid->inputs, list) {
|
list_for_each_entry(hidinput, &hid->inputs, list) {
|
||||||
if (hidinput->report &&
|
if (hidinput->application == report->application)
|
||||||
hidinput->report->application == report->application)
|
|
||||||
return hidinput;
|
return hidinput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1697,6 +1697,9 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||||
*/
|
*/
|
||||||
hdev->quirks |= HID_QUIRK_INPUT_PER_APP;
|
hdev->quirks |= HID_QUIRK_INPUT_PER_APP;
|
||||||
|
|
||||||
|
if (id->group != HID_GROUP_MULTITOUCH_WIN_8)
|
||||||
|
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
|
||||||
|
|
||||||
timer_setup(&td->release_timer, mt_expired_timeout, 0);
|
timer_setup(&td->release_timer, mt_expired_timeout, 0);
|
||||||
|
|
||||||
ret = hid_parse(hdev);
|
ret = hid_parse(hdev);
|
||||||
|
|
|
@ -526,6 +526,7 @@ struct hid_input {
|
||||||
const char *name;
|
const char *name;
|
||||||
bool registered;
|
bool registered;
|
||||||
struct list_head reports; /* the list of reports */
|
struct list_head reports; /* the list of reports */
|
||||||
|
unsigned int application; /* application usage for this input */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum hid_type {
|
enum hid_type {
|
||||||
|
|
Loading…
Reference in New Issue