Skip to content

Commit b2723eb

Browse files
mungewellJiri Kosina
authored andcommitted
HID: hid-sony: Fix report descriptor for Navigation Controller
Patch report descriptor to remove unused and ramdomly changing axis. Original report descriptor (via BT) was as follows: 00000000 05 01 09 04 a1 01 a1 02 85 01 75 08 95 01 15 00 |..........u.....| 00000010 26 ff 00 81 03 75 01 95 13 15 00 25 01 35 00 45 |&....u.....%.5.E| 00000020 01 05 09 19 01 29 13 81 02 75 01 95 0d 06 00 ff |.....)...u......| 00000030 81 03 15 00 26 ff 00 05 01 09 01 a1 00 75 08 95 |....&........u..| 00000040 04 35 00 46 ff 00 09 30 09 31 09 32 09 35 81 02 |.5.F...0.1.2.5..| 00000050 c0 05 01 75 08 95 27 09 01 81 02 75 08 95 30 09 |...u..'....u..0.| 00000060 01 91 02 75 08 95 30 09 01 b1 02 c0 a1 02 85 02 |...u..0.........| 00000070 75 08 95 30 09 01 b1 02 c0 a1 02 85 ee 75 08 95 |u..0.........u..| 00000080 30 09 01 b1 02 c0 a1 02 85 ef 75 08 95 30 09 01 |0.........u..0..| 00000090 b1 02 c0 c0 00 |.....| 00000095 Signed-off-by: Simon Wood <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 4545ee0 commit b2723eb

File tree

1 file changed

+90
-1
lines changed

1 file changed

+90
-1
lines changed

drivers/hid/hid-sony.c

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,88 @@ static __u8 motion_rdesc[] = {
248248
0xC0 /* End Collection */
249249
};
250250

251+
/* PS/3 Navigation controller */
252+
static __u8 navigation_rdesc[] = {
253+
0x05, 0x01, /* Usage Page (Desktop), */
254+
0x09, 0x04, /* Usage (Joystik), */
255+
0xA1, 0x01, /* Collection (Application), */
256+
0xA1, 0x02, /* Collection (Logical), */
257+
0x85, 0x01, /* Report ID (1), */
258+
0x75, 0x08, /* Report Size (8), */
259+
0x95, 0x01, /* Report Count (1), */
260+
0x15, 0x00, /* Logical Minimum (0), */
261+
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
262+
0x81, 0x03, /* Input (Constant, Variable), */
263+
0x75, 0x01, /* Report Size (1), */
264+
0x95, 0x13, /* Report Count (19), */
265+
0x15, 0x00, /* Logical Minimum (0), */
266+
0x25, 0x01, /* Logical Maximum (1), */
267+
0x35, 0x00, /* Physical Minimum (0), */
268+
0x45, 0x01, /* Physical Maximum (1), */
269+
0x05, 0x09, /* Usage Page (Button), */
270+
0x19, 0x01, /* Usage Minimum (01h), */
271+
0x29, 0x13, /* Usage Maximum (13h), */
272+
0x81, 0x02, /* Input (Variable), */
273+
0x75, 0x01, /* Report Size (1), */
274+
0x95, 0x0D, /* Report Count (13), */
275+
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
276+
0x81, 0x03, /* Input (Constant, Variable), */
277+
0x15, 0x00, /* Logical Minimum (0), */
278+
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
279+
0x05, 0x01, /* Usage Page (Desktop), */
280+
0x09, 0x01, /* Usage (Pointer), */
281+
0xA1, 0x00, /* Collection (Physical), */
282+
0x75, 0x08, /* Report Size (8), */
283+
0x95, 0x02, /* Report Count (2), */
284+
0x35, 0x00, /* Physical Minimum (0), */
285+
0x46, 0xFF, 0x00, /* Physical Maximum (255), */
286+
0x09, 0x30, /* Usage (X), */
287+
0x09, 0x31, /* Usage (Y), */
288+
0x81, 0x02, /* Input (Variable), */
289+
0xC0, /* End Collection, */
290+
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
291+
0x95, 0x06, /* Report Count (6), */
292+
0x81, 0x03, /* Input (Constant, Variable), */
293+
0x05, 0x01, /* Usage Page (Desktop), */
294+
0x75, 0x08, /* Report Size (8), */
295+
0x95, 0x05, /* Report Count (5), */
296+
0x09, 0x01, /* Usage (Pointer), */
297+
0x81, 0x02, /* Input (Variable), */
298+
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
299+
0x95, 0x20, /* Report Count (26), */
300+
0x81, 0x02, /* Input (Variable), */
301+
0x75, 0x08, /* Report Size (8), */
302+
0x95, 0x30, /* Report Count (48), */
303+
0x09, 0x01, /* Usage (Pointer), */
304+
0x91, 0x02, /* Output (Variable), */
305+
0x75, 0x08, /* Report Size (8), */
306+
0x95, 0x30, /* Report Count (48), */
307+
0x09, 0x01, /* Usage (Pointer), */
308+
0xB1, 0x02, /* Feature (Variable), */
309+
0xC0, /* End Collection, */
310+
0xA1, 0x02, /* Collection (Logical), */
311+
0x85, 0x02, /* Report ID (2), */
312+
0x75, 0x08, /* Report Size (8), */
313+
0x95, 0x30, /* Report Count (48), */
314+
0x09, 0x01, /* Usage (Pointer), */
315+
0xB1, 0x02, /* Feature (Variable), */
316+
0xC0, /* End Collection, */
317+
0xA1, 0x02, /* Collection (Logical), */
318+
0x85, 0xEE, /* Report ID (238), */
319+
0x75, 0x08, /* Report Size (8), */
320+
0x95, 0x30, /* Report Count (48), */
321+
0x09, 0x01, /* Usage (Pointer), */
322+
0xB1, 0x02, /* Feature (Variable), */
323+
0xC0, /* End Collection, */
324+
0xA1, 0x02, /* Collection (Logical), */
325+
0x85, 0xEF, /* Report ID (239), */
326+
0x75, 0x08, /* Report Size (8), */
327+
0x95, 0x30, /* Report Count (48), */
328+
0x09, 0x01, /* Usage (Pointer), */
329+
0xB1, 0x02, /* Feature (Variable), */
330+
0xC0, /* End Collection, */
331+
0xC0 /* End Collection */
332+
};
251333

252334
/*
253335
* The default descriptor doesn't provide mapping for the accelerometers
@@ -974,6 +1056,13 @@ static u8 *motion_fixup(struct hid_device *hdev, u8 *rdesc,
9741056
return motion_rdesc;
9751057
}
9761058

1059+
static u8 *navigation_fixup(struct hid_device *hdev, u8 *rdesc,
1060+
unsigned int *rsize)
1061+
{
1062+
*rsize = sizeof(navigation_rdesc);
1063+
return navigation_rdesc;
1064+
}
1065+
9771066
static __u8 *ps3remote_fixup(struct hid_device *hdev, __u8 *rdesc,
9781067
unsigned int *rsize)
9791068
{
@@ -1058,7 +1147,7 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
10581147
return motion_fixup(hdev, rdesc, rsize);
10591148

10601149
if (sc->quirks & NAVIGATION_CONTROLLER)
1061-
return sixaxis_fixup(hdev, rdesc, rsize);
1150+
return navigation_fixup(hdev, rdesc, rsize);
10621151

10631152
if (sc->quirks & PS3REMOTE)
10641153
return ps3remote_fixup(hdev, rdesc, rsize);

0 commit comments

Comments
 (0)