Skip to content

Commit

Permalink
HID: adjust report descriptor fixup for MS 1028 receiver
Browse files Browse the repository at this point in the history
Report descriptor fixup for MS 1028 receiver changes also values for
Keyboard and Consumer, which incorrectly trims the range, causing correct
events being thrown away before passing to userspace.

We need to keep the GenDesk usage fixup though, as it reports totally bogus
values about axis.

Reported-by: Lucas Gadani <lgadani@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Kosina committed Jan 29, 2009
1 parent 18e352e commit 0fb21de
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/hid/hid-microsoft.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,20 @@
#define MS_NOGET 0x10

/*
* Microsoft Wireless Desktop Receiver (Model 1028) has several
* Microsoft Wireless Desktop Receiver (Model 1028) has
* 'Usage Min/Max' where it ought to have 'Physical Min/Max'
*/
static void ms_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int rsize)
{
unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);

if ((quirks & MS_RDESC) && rsize == 571 && rdesc[284] == 0x19 &&
rdesc[286] == 0x2a && rdesc[304] == 0x19 &&
rdesc[306] == 0x29 && rdesc[352] == 0x1a &&
rdesc[355] == 0x2a && rdesc[557] == 0x19 &&
if ((quirks & MS_RDESC) && rsize == 571 && rdesc[557] == 0x19 &&
rdesc[559] == 0x29) {
dev_info(&hdev->dev, "fixing up Microsoft Wireless Receiver "
"Model 1028 report descriptor\n");
rdesc[284] = rdesc[304] = rdesc[557] = 0x35;
rdesc[352] = 0x36;
rdesc[286] = rdesc[355] = 0x46;
rdesc[306] = rdesc[559] = 0x45;
rdesc[557] = 0x35;
rdesc[559] = 0x45;
}
}

Expand Down

0 comments on commit 0fb21de

Please sign in to comment.