diff options
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-sony.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 7f33ebf299c2..16df4d84f525 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -33,6 +33,28 @@ static const u8 sixaxis_rdesc_fixup[] = { | |||
33 | 0x03, 0x46, 0xFF, 0x03, 0x09, 0x01, 0x81, 0x02 | 33 | 0x03, 0x46, 0xFF, 0x03, 0x09, 0x01, 0x81, 0x02 |
34 | }; | 34 | }; |
35 | 35 | ||
36 | static const u8 sixaxis_rdesc_fixup2[] = { | ||
37 | 0x05, 0x01, 0x09, 0x04, 0xa1, 0x01, 0xa1, 0x02, | ||
38 | 0x85, 0x01, 0x75, 0x08, 0x95, 0x01, 0x15, 0x00, | ||
39 | 0x26, 0xff, 0x00, 0x81, 0x03, 0x75, 0x01, 0x95, | ||
40 | 0x13, 0x15, 0x00, 0x25, 0x01, 0x35, 0x00, 0x45, | ||
41 | 0x01, 0x05, 0x09, 0x19, 0x01, 0x29, 0x13, 0x81, | ||
42 | 0x02, 0x75, 0x01, 0x95, 0x0d, 0x06, 0x00, 0xff, | ||
43 | 0x81, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, 0x05, | ||
44 | 0x01, 0x09, 0x01, 0xa1, 0x00, 0x75, 0x08, 0x95, | ||
45 | 0x04, 0x35, 0x00, 0x46, 0xff, 0x00, 0x09, 0x30, | ||
46 | 0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x81, 0x02, | ||
47 | 0xc0, 0x05, 0x01, 0x95, 0x13, 0x09, 0x01, 0x81, | ||
48 | 0x02, 0x95, 0x0c, 0x81, 0x01, 0x75, 0x10, 0x95, | ||
49 | 0x04, 0x26, 0xff, 0x03, 0x46, 0xff, 0x03, 0x09, | ||
50 | 0x01, 0x81, 0x02, 0xc0, 0xa1, 0x02, 0x85, 0x02, | ||
51 | 0x75, 0x08, 0x95, 0x30, 0x09, 0x01, 0xb1, 0x02, | ||
52 | 0xc0, 0xa1, 0x02, 0x85, 0xee, 0x75, 0x08, 0x95, | ||
53 | 0x30, 0x09, 0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02, | ||
54 | 0x85, 0xef, 0x75, 0x08, 0x95, 0x30, 0x09, 0x01, | ||
55 | 0xb1, 0x02, 0xc0, 0xc0, | ||
56 | }; | ||
57 | |||
36 | struct sony_sc { | 58 | struct sony_sc { |
37 | unsigned long quirks; | 59 | unsigned long quirks; |
38 | }; | 60 | }; |
@@ -56,6 +78,12 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
56 | hid_info(hdev, "Fixing up Sony Sixaxis report descriptor\n"); | 78 | hid_info(hdev, "Fixing up Sony Sixaxis report descriptor\n"); |
57 | memcpy((void *)&rdesc[83], (void *)&sixaxis_rdesc_fixup, | 79 | memcpy((void *)&rdesc[83], (void *)&sixaxis_rdesc_fixup, |
58 | sizeof(sixaxis_rdesc_fixup)); | 80 | sizeof(sixaxis_rdesc_fixup)); |
81 | } else if (sc->quirks & SIXAXIS_CONTROLLER_USB && | ||
82 | *rsize > sizeof(sixaxis_rdesc_fixup2)) { | ||
83 | hid_info(hdev, "Sony Sixaxis clone detected. Using original report descriptor (size: %d clone; %d new)\n", | ||
84 | *rsize, (int)sizeof(sixaxis_rdesc_fixup2)); | ||
85 | *rsize = sizeof(sixaxis_rdesc_fixup2); | ||
86 | memcpy(rdesc, &sixaxis_rdesc_fixup2, *rsize); | ||
59 | } | 87 | } |
60 | return rdesc; | 88 | return rdesc; |
61 | } | 89 | } |