projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b912cf0
)
HID: do not assume HAT Switch logical max < 8
author
Benjamin Tissoires
<bentiss@kernel.org>
Wed, 10 Apr 2024 17:19:21 +0000
(19:19 +0200)
committer
Benjamin Tissoires
<bentiss@kernel.org>
Tue, 7 May 2024 13:38:36 +0000
(15:38 +0200)
Turns out that the code can handle a greater range, but the data stored
can not. This is problematic on the Raptor Mach 2 joystick which
logical max is 239. The kernel interprets it as `-15` and thus ignores
the Hat Switch handling.
Link:
https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/issues/17
Link:
https://lore.kernel.org/r/20240410-bpf_sources-v1-1-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
include/linux/hid.h
patch
|
blob
|
history
diff --git
a/include/linux/hid.h
b/include/linux/hid.h
index b12cb1c8e68214a13da61064c2857a02e4055b1d..8e06d89698e671a8d4425bb5abfcc8a87c6392c1 100644
(file)
--- a/
include/linux/hid.h
+++ b/
include/linux/hid.h
@@
-474,9
+474,9
@@
struct hid_usage {
__s8 wheel_factor; /* 120/resolution_multiplier */
__u16 code; /* input driver code */
__u8 type; /* input driver type */
- __s
8
hat_min; /* hat switch fun */
- __s
8
hat_max; /* ditto */
- __s
8
hat_dir; /* ditto */
+ __s
16
hat_min; /* hat switch fun */
+ __s
16
hat_max; /* ditto */
+ __s
16
hat_dir; /* ditto */
__s16 wheel_accumulated; /* hi-res wheel */
};