Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
6c454a8a
Commit
6c454a8a
authored
21 years ago
by
Zephaniah E. Hull
Committed by
Vojtech Pavlik
21 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: Implement a HID quirk for 2-wheel A4Tech mice.
parent
2004b8b7
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
+32
-7
drivers/usb/input/hid-core.c
drivers/usb/input/hid-core.c
+4
-0
drivers/usb/input/hid-input.c
drivers/usb/input/hid-input.c
+19
-0
drivers/usb/input/hid.h
drivers/usb/input/hid.h
+9
-7
No files found.
drivers/usb/input/hid-core.c
View file @
6c454a8a
...
...
@@ -1351,6 +1351,9 @@ void hid_init_reports(struct hid_device *hid)
#define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f
#define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100
#define USB_VENDOR_ID_A4TECH 0x09DA
#define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006
struct
hid_blacklist
{
__u16
idVendor
;
__u16
idProduct
;
...
...
@@ -1398,6 +1401,7 @@ struct hid_blacklist {
{
USB_VENDOR_ID_ONTRAK
,
USB_DEVICE_ID_ONTRAK_ADU100
+
500
,
HID_QUIRK_IGNORE
},
{
USB_VENDOR_ID_TANGTOP
,
USB_DEVICE_ID_TANGTOP_USBPS2
,
HID_QUIRK_NOGET
},
{
USB_VENDOR_ID_ESSENTIAL_REALITY
,
USB_DEVICE_ID_ESSENTIAL_REALITY_P5
,
HID_QUIRK_IGNORE
},
{
USB_VENDOR_ID_A4TECH
,
USB_DEVICE_ID_A4TECH_WCP32PU
,
HID_QUIRK_2WHEEL_MOUSE_HACK
},
{
0
,
0
}
};
...
...
This diff is collapsed.
Click to expand it.
drivers/usb/input/hid-input.c
View file @
6c454a8a
...
...
@@ -376,6 +376,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
}
set_bit
(
usage
->
type
,
input
->
evbit
);
if
((
usage
->
type
==
EV_REL
)
&&
(
device
->
quirks
&
HID_QUIRK_2WHEEL_MOUSE_HACK
)
&&
(
usage
->
code
==
REL_WHEEL
))
{
set_bit
(
REL_HWHEEL
,
bit
);
}
while
(
usage
->
code
<=
max
&&
test_and_set_bit
(
usage
->
code
,
bit
))
{
usage
->
code
=
find_next_zero_bit
(
bit
,
max
+
1
,
usage
->
code
);
...
...
@@ -426,6 +431,20 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
input_regs
(
input
,
regs
);
if
((
hid
->
quirks
&
HID_QUIRK_2WHEEL_MOUSE_HACK
)
&&
(
usage
->
code
==
BTN_BACK
))
{
if
(
value
)
hid
->
quirks
|=
HID_QUIRK_2WHEEL_MOUSE_HACK_ON
;
else
hid
->
quirks
&=
~
HID_QUIRK_2WHEEL_MOUSE_HACK_ON
;
return
;
}
if
((
hid
->
quirks
&
HID_QUIRK_2WHEEL_MOUSE_HACK_ON
)
&&
(
usage
->
code
==
REL_WHEEL
))
{
input_event
(
input
,
usage
->
type
,
REL_HWHEEL
,
value
);
return
;
}
if
(
usage
->
hat_min
!=
usage
->
hat_max
)
{
value
=
(
value
-
usage
->
hat_min
)
*
8
/
(
usage
->
hat_max
-
usage
->
hat_min
+
1
)
+
1
;
if
(
value
<
0
||
value
>
8
)
value
=
0
;
...
...
This diff is collapsed.
Click to expand it.
drivers/usb/input/hid.h
View file @
6c454a8a
...
...
@@ -201,13 +201,15 @@ struct hid_item {
* HID device quirks.
*/
#define HID_QUIRK_INVERT 0x01
#define HID_QUIRK_NOTOUCH 0x02
#define HID_QUIRK_IGNORE 0x04
#define HID_QUIRK_NOGET 0x08
#define HID_QUIRK_HIDDEV 0x10
#define HID_QUIRK_BADPAD 0x20
#define HID_QUIRK_MULTI_INPUT 0x40
#define HID_QUIRK_INVERT 0x001
#define HID_QUIRK_NOTOUCH 0x002
#define HID_QUIRK_IGNORE 0x004
#define HID_QUIRK_NOGET 0x008
#define HID_QUIRK_HIDDEV 0x010
#define HID_QUIRK_BADPAD 0x020
#define HID_QUIRK_MULTI_INPUT 0x040
#define HID_QUIRK_2WHEEL_MOUSE_HACK 0x080
#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x100
/*
* This is the global environment of the parser. This information is
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment