diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2018-04-24 04:04:32 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-04-26 08:17:31 -0400 |
commit | e1b63c0148a7f8edf1691770ec0527fe86fb6ab8 (patch) | |
tree | 344dd91cf00f9e8d9a256499e01e00cb906f371b | |
parent | 190d7f02ce8ef6774a69d3ec18c288c8a9601a4e (diff) |
HID: store the full list of reports in the hidinput
We were only storing the report in case of QUIRK_MULTI_INPUT.
It is interesting for the upcoming HID_QUIRK_INPUT_PER_APP to also
store the full list of reports that are attached to it.
We need the full list because a device (Advanced Silicon has some)
might want to use a different report ID for the Input reports and
the Output reports. Storing the full list allows the drivers to
have all the data.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/hid-input.c | 6 | ||||
-rw-r--r-- | include/linux/hid.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 04056773102e..fd1c4fe70327 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -1526,9 +1526,12 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid) | |||
1526 | input_dev->id.product = hid->product; | 1526 | input_dev->id.product = hid->product; |
1527 | input_dev->id.version = hid->version; | 1527 | input_dev->id.version = hid->version; |
1528 | input_dev->dev.parent = &hid->dev; | 1528 | input_dev->dev.parent = &hid->dev; |
1529 | |||
1529 | hidinput->input = input_dev; | 1530 | hidinput->input = input_dev; |
1530 | list_add_tail(&hidinput->list, &hid->inputs); | 1531 | list_add_tail(&hidinput->list, &hid->inputs); |
1531 | 1532 | ||
1533 | INIT_LIST_HEAD(&hidinput->reports); | ||
1534 | |||
1532 | return hidinput; | 1535 | return hidinput; |
1533 | } | 1536 | } |
1534 | 1537 | ||
@@ -1678,6 +1681,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
1678 | 1681 | ||
1679 | if (hid->quirks & HID_QUIRK_MULTI_INPUT) | 1682 | if (hid->quirks & HID_QUIRK_MULTI_INPUT) |
1680 | hidinput->report = report; | 1683 | hidinput->report = report; |
1684 | |||
1685 | list_add_tail(&report->hidinput_list, | ||
1686 | &hidinput->reports); | ||
1681 | } | 1687 | } |
1682 | } | 1688 | } |
1683 | 1689 | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h index 0267aa5c1ea3..396068ccc197 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -464,6 +464,7 @@ struct hid_field { | |||
464 | 464 | ||
465 | struct hid_report { | 465 | struct hid_report { |
466 | struct list_head list; | 466 | struct list_head list; |
467 | struct list_head hidinput_list; | ||
467 | unsigned id; /* id of this report */ | 468 | unsigned id; /* id of this report */ |
468 | unsigned type; /* report type */ | 469 | unsigned type; /* report type */ |
469 | struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */ | 470 | struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */ |
@@ -510,6 +511,7 @@ struct hid_input { | |||
510 | struct hid_report *report; | 511 | struct hid_report *report; |
511 | struct input_dev *input; | 512 | struct input_dev *input; |
512 | bool registered; | 513 | bool registered; |
514 | struct list_head reports; /* the list of reports */ | ||
513 | }; | 515 | }; |
514 | 516 | ||
515 | enum hid_type { | 517 | enum hid_type { |