diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2018-04-24 10:04:33 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-04-26 14:17:31 +0200 |
commit | f07b3c1da92db108662f99417a212fc1eddc44d1 (patch) | |
tree | d4ad0e580dfab744d34460c80a361e78c7ff47dd /include/linux/hid.h | |
parent | e1b63c0148a7f8edf1691770ec0527fe86fb6ab8 (diff) | |
download | linux-f07b3c1da92db108662f99417a212fc1eddc44d1.tar.gz linux-f07b3c1da92db108662f99417a212fc1eddc44d1.tar.bz2 linux-f07b3c1da92db108662f99417a212fc1eddc44d1.zip |
HID: generic: create one input report per application type
It is not a good idea to try to fit all types of applications in the
same input report. There are a lot of devices that are needing
the quirk HID_MULTI_INPUT but this quirk doesn't match the actual HID
description as it is based on the report ID.
Given that most devices with MULTI_INPUT I can think of split nicely
the devices inputs into application, it is a good thing to split the
devices by default based on this assumption.
Also make hid-multitouch following this rule, to not have to deal
with too many input created.
While we are at it, fix some checkpatch complaints about converting
'unsigned' to 'unsigned int'.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 396068ccc197..bcc91bfdd2cb 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -341,6 +341,7 @@ struct hid_item { /* BIT(8) reserved for backward compatibility, was HID_QUIRK_NO_EMPTY_INPUT */ /* BIT(9) reserved for backward compatibility, was NO_INIT_INPUT_REPORTS */ #define HID_QUIRK_ALWAYS_POLL BIT(10) +#define HID_QUIRK_INPUT_PER_APP BIT(11) #define HID_QUIRK_SKIP_OUTPUT_REPORTS BIT(16) #define HID_QUIRK_SKIP_OUTPUT_REPORT_ID BIT(17) #define HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP BIT(18) @@ -465,8 +466,9 @@ struct hid_field { struct hid_report { struct list_head list; struct list_head hidinput_list; - unsigned id; /* id of this report */ - unsigned type; /* report type */ + unsigned int id; /* id of this report */ + unsigned int type; /* report type */ + unsigned int application; /* application usage for this report */ struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */ unsigned maxfield; /* maximum valid field index */ unsigned size; /* size of the report (bits) */ @@ -861,7 +863,9 @@ void hid_output_report(struct hid_report *report, __u8 *data); void __hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype); u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags); struct hid_device *hid_allocate_device(void); -struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); +struct hid_report *hid_register_report(struct hid_device *device, + unsigned int type, unsigned int id, + unsigned int application); int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); struct hid_report *hid_validate_values(struct hid_device *hid, unsigned int type, unsigned int id, |