Skip to content

Commit 0d6c301

Browse files
bentissJiri Kosina
authored andcommitted
HID: core: fix grouping by application
commit f07b3c1 ("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: NixOS/nixpkgs#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>
1 parent ec6adef commit 0d6c301

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

drivers/hid/hid-input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
15821582
input_dev->dev.parent = &hid->dev;
15831583

15841584
hidinput->input = input_dev;
1585+
hidinput->application = application;
15851586
list_add_tail(&hidinput->list, &hid->inputs);
15861587

15871588
INIT_LIST_HEAD(&hidinput->reports);
@@ -1677,8 +1678,7 @@ static struct hid_input *hidinput_match_application(struct hid_report *report)
16771678
struct hid_input *hidinput;
16781679

16791680
list_for_each_entry(hidinput, &hid->inputs, list) {
1680-
if (hidinput->report &&
1681-
hidinput->report->application == report->application)
1681+
if (hidinput->application == report->application)
16821682
return hidinput;
16831683
}
16841684

drivers/hid/hid-multitouch.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,9 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
16971697
*/
16981698
hdev->quirks |= HID_QUIRK_INPUT_PER_APP;
16991699

1700+
if (id->group != HID_GROUP_MULTITOUCH_WIN_8)
1701+
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
1702+
17001703
timer_setup(&td->release_timer, mt_expired_timeout, 0);
17011704

17021705
ret = hid_parse(hdev);

include/linux/hid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ struct hid_input {
526526
const char *name;
527527
bool registered;
528528
struct list_head reports; /* the list of reports */
529+
unsigned int application; /* application usage for this input */
529530
};
530531

531532
enum hid_type {

0 commit comments

Comments
 (0)