Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256805
b: refs/heads/master
c: 61ab44b
h: refs/heads/master
i:
  256803: bb26898
v: v3
  • Loading branch information
Simon Wood authored and Jiri Kosina committed Jun 13, 2011
1 parent c521395 commit 0726891
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 74bc6953135ae1478acc18046321bfca05b0e823
refs/heads/master: 61ab44bebdefab296487e7cd723a634849278827
15 changes: 15 additions & 0 deletions trunk/drivers/hid/hid-sony.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
#define SIXAXIS_CONTROLLER_USB (1 << 1)
#define SIXAXIS_CONTROLLER_BT (1 << 2)

static const u8 sixaxis_rdesc_fixup[] = {
0x95, 0x13, 0x09, 0x01, 0x81, 0x02, 0x95, 0x0C,
0x81, 0x01, 0x75, 0x10, 0x95, 0x04, 0x26, 0xFF,
0x03, 0x46, 0xFF, 0x03, 0x09, 0x01, 0x81, 0x02
};

struct sony_sc {
unsigned long quirks;
};
Expand All @@ -43,6 +49,15 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
hid_info(hdev, "Fixing up Sony Vaio VGX report descriptor\n");
rdesc[55] = 0x06;
}

/* The HID descriptor exposed over BT has a trailing zero byte */
if ((((sc->quirks & SIXAXIS_CONTROLLER_USB) && *rsize == 148) ||
((sc->quirks & SIXAXIS_CONTROLLER_BT) && *rsize == 149)) &&
rdesc[83] == 0x75) {
hid_info(hdev, "Fixing up Sony Sixaxis report descriptor\n");
memcpy((void *)&rdesc[83], (void *)&sixaxis_rdesc_fixup,
sizeof(sixaxis_rdesc_fixup));
}
return rdesc;
}

Expand Down

0 comments on commit 0726891

Please sign in to comment.