diff options
| author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2017-12-08 09:28:18 -0500 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2018-04-17 08:08:54 -0400 |
| commit | 190d7f02ce8ef6774a69d3ec18c288c8a9601a4e (patch) | |
| tree | 4953de950ebd7fa3aaf9cd4e4c94fc1c34aa59f3 /include | |
| parent | e8403b493fd5180e351ca67eb66406d95dadcd0b (diff) | |
HID: input: do not increment usages when a duplicate is found
This is something that bothered us from a long time. When hid-input
doesn't know how to map a usage, it uses *_MISC. But there is something
else which increments the usage if the evdev code is already used.
This leads to few issues:
- some devices may have their ABS_X mapped to ABS_Y if they export a bad
set of usages (see the DragonRise joysticks IIRC -> fixed in a specific
HID driver)
- *_MISC + N might (will) conflict with other defined axes (my Logitech
H800 exports some multitouch axes because of that)
- this prevents to freely add some new evdev usages, because "hey, my
headset will now report ABS_COFFEE, and it's not coffee capable".
So let's try to kill this nonsense, and hope we won't break too many
devices.
I my headset case, the ABS_MISC axes are created because of some
proprietary usages, so we might not break that many devices.
For backward compatibility, a quirk HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE
is created and can be applied to any device that needs this behavior.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/hid.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 8da3e1f48195..0267aa5c1ea3 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -345,6 +345,7 @@ struct hid_item { | |||
| 345 | #define HID_QUIRK_SKIP_OUTPUT_REPORT_ID BIT(17) | 345 | #define HID_QUIRK_SKIP_OUTPUT_REPORT_ID BIT(17) |
| 346 | #define HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP BIT(18) | 346 | #define HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP BIT(18) |
| 347 | #define HID_QUIRK_HAVE_SPECIAL_DRIVER BIT(19) | 347 | #define HID_QUIRK_HAVE_SPECIAL_DRIVER BIT(19) |
| 348 | #define HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE BIT(20) | ||
| 348 | #define HID_QUIRK_FULLSPEED_INTERVAL BIT(28) | 349 | #define HID_QUIRK_FULLSPEED_INTERVAL BIT(28) |
| 349 | #define HID_QUIRK_NO_INIT_REPORTS BIT(29) | 350 | #define HID_QUIRK_NO_INIT_REPORTS BIT(29) |
| 350 | #define HID_QUIRK_NO_IGNORE BIT(30) | 351 | #define HID_QUIRK_NO_IGNORE BIT(30) |
| @@ -502,6 +503,7 @@ struct hid_output_fifo { | |||
| 502 | 503 | ||
| 503 | #define HID_STAT_ADDED BIT(0) | 504 | #define HID_STAT_ADDED BIT(0) |
| 504 | #define HID_STAT_PARSED BIT(1) | 505 | #define HID_STAT_PARSED BIT(1) |
| 506 | #define HID_STAT_DUP_DETECTED BIT(2) | ||
| 505 | 507 | ||
| 506 | struct hid_input { | 508 | struct hid_input { |
| 507 | struct list_head list; | 509 | struct list_head list; |
