]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.fixes/hid-rdesc-quirk-for-sony-vaio-VGX-TP1E.patch
Updated xen patches taken from suse.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / hid-rdesc-quirk-for-sony-vaio-VGX-TP1E.patch
1 From: Jiri Kosina <jkosina@suse.cz>
2 Subject: HID: Fix Sony Vaio VGX report descriptor
3 References: bnc#437758
4 Patch-mainline: queued in subsystem tree, planned for 2.6.28
5
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
8 usages.
9
10 Fix the report descriptor before it enters the parses to contain correct
11 data.
12
13 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
14
15 ---
16 drivers/hid/usbhid/hid-quirks.c | 16 ++++++++++++++++
17 include/linux/hid.h | 1 +
18 2 files changed, 17 insertions(+)
19
20 --- a/drivers/hid/usbhid/hid-quirks.c
21 +++ b/drivers/hid/usbhid/hid-quirks.c
22 @@ -383,6 +383,7 @@
23 #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
24
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
28
29 #define USB_VENDOR_ID_SOUNDGRAPH 0x15c2
30 @@ -761,6 +762,8 @@ static const struct hid_rdesc_blacklist
31
32 { USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP, HID_QUIRK_RDESC_SUNPLUS_WDESKTOP },
33
34 + { USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE, HID_QUIRK_RDESC_SONY_VAIO_VGX },
35 +
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 },
38
39 @@ -1133,6 +1136,16 @@ static void usbhid_fixup_button_consumer
40 }
41 }
42
43 +/* Sony Vaio VGX has wrongly mouse pointer declared as constant */
44 +static void usbhid_fixup_sony_vaio_vgx(unsigned char *rdesc, int rsize)
45 +{
46 + if (rsize >= 56 && rdesc[54] == 0x81
47 + && rdesc[55] == 0x07) {
48 + printk(KERN_INFO "Fixing up Sony Vaio VGX report descriptor\n");
49 + rdesc[55] = 0x06;
50 + }
51 +}
52 +
53 /*
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
57
58 if (quirks & HID_QUIRK_RDESC_SUNPLUS_WDESKTOP)
59 usbhid_fixup_sunplus_wdesktop(rdesc, rsize);
60 +
61 + if (quirks & HID_QUIRK_RDESC_SONY_VAIO_VGX)
62 + usbhid_fixup_sony_vaio_vgx(rdesc, rsize);
63 }
64
65 /**
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
73
74 /*
75 * This is the global environment of the parser. This information is