1 From: Jiri Kosina <jkosina@suse.cz>
2 Subject: HID: Fix Sony Vaio VGX report descriptor
4 Patch-mainline: queued in subsystem tree, planned for 2.6.28
6 Sony Vaio VGX has wrongly mouse pointer declared as constant non-data
7 variable, which make HID code to completely ignore all the Pointer
10 Fix the report descriptor before it enters the parses to contain correct
13 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
16 drivers/hid/usbhid/hid-quirks.c | 16 ++++++++++++++++
17 include/linux/hid.h | 1 +
18 2 files changed, 17 insertions(+)
20 --- a/drivers/hid/usbhid/hid-quirks.c
21 +++ b/drivers/hid/usbhid/hid-quirks.c
23 #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
25 #define USB_VENDOR_ID_SONY 0x054c
26 +#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE 0x024b
27 #define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268
29 #define USB_VENDOR_ID_SOUNDGRAPH 0x15c2
30 @@ -761,6 +762,8 @@ static const struct hid_rdesc_blacklist
32 { USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP, HID_QUIRK_RDESC_SUNPLUS_WDESKTOP },
34 + { USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE, HID_QUIRK_RDESC_SONY_VAIO_VGX },
36 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
37 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
39 @@ -1133,6 +1136,16 @@ static void usbhid_fixup_button_consumer
43 +/* Sony Vaio VGX has wrongly mouse pointer declared as constant */
44 +static void usbhid_fixup_sony_vaio_vgx(unsigned char *rdesc, int rsize)
46 + if (rsize >= 56 && rdesc[54] == 0x81
47 + && rdesc[55] == 0x07) {
48 + printk(KERN_INFO "Fixing up Sony Vaio VGX report descriptor\n");
54 * Microsoft Wireless Desktop Receiver (Model 1028) has
55 * 'Usage Min/Max' where it ought to have 'Physical Min/Max'
56 @@ -1175,6 +1188,9 @@ static void __usbhid_fixup_report_descri
58 if (quirks & HID_QUIRK_RDESC_SUNPLUS_WDESKTOP)
59 usbhid_fixup_sunplus_wdesktop(rdesc, rsize);
61 + if (quirks & HID_QUIRK_RDESC_SONY_VAIO_VGX)
62 + usbhid_fixup_sony_vaio_vgx(rdesc, rsize);
66 --- a/include/linux/hid.h
67 +++ b/include/linux/hid.h
68 @@ -298,6 +298,7 @@ struct hid_item {
69 #define HID_QUIRK_RDESC_SAMSUNG_REMOTE 0x00000040
70 #define HID_QUIRK_RDESC_MICROSOFT_RECV_1028 0x00000080
71 #define HID_QUIRK_RDESC_SUNPLUS_WDESKTOP 0x00000100
72 +#define HID_QUIRK_RDESC_SONY_VAIO_VGX 0x00000200
75 * This is the global environment of the parser. This information is