summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-glorious.c
AgeCommit message (Collapse)AuthorFilesLines
2020-03-18HID: Add driver fixing Glorious PC Gaming Race mouse report descriptorSamuel Čavoj1-0/+86
The Glorious Model O mice (and also at least the Model O-, which is driver-wise the same mouse) have a bug in the descriptor of HID Report with ID 2. This report is used for Consumer Control buttons, which can be mapped using the provided Windows only software. Here is an excerpt from the original descriptor: INPUT(2)[INPUT] Field(0) Flags( Constant Variable Absolute ) Field(1) Flags( Constant Variable Absolute ) Field(2) Flags( Constant Variable Absolute ) The issue is the Constant flag specified on all 3 fields, which causes the hid driver to ignore changes in these fields and essentialy causes the buttons to not work at all. The submitted driver patches the descriptor to end up with the following: INPUT(2)[INPUT] Field(0) Flags( Variable Relative ) Field(1) Flags( Variable Relative ) Field(2) Flags( Variable Relative ) The Constant bit is reset and the Relative bit has been set in order to prevent repeat events when holding down the button. Additionally, the device name is changed from the hardware-reported "SINOWEALTH Wired Gaming Mouse" to "Glorious Model O" or "Glorious Model D". Signed-off-by: Samuel Čavoj <sammko@sammserver.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>