Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256806
b: refs/heads/master
c: c9e4d87
h: refs/heads/master
v: v3
  • Loading branch information
Simon Wood authored and Jiri Kosina committed Jun 13, 2011
1 parent 0726891 commit b06d3c0
Show file tree
Hide file tree
Showing 2 changed files with 21 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: 61ab44bebdefab296487e7cd723a634849278827
refs/heads/master: c9e4d87758e95ef9d78a7767e2405ebaf54adcd8
20 changes: 20 additions & 0 deletions trunk/drivers/hid/hid-sony.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
return rdesc;
}

static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
__u8 *rd, int size)
{
struct sony_sc *sc = hid_get_drvdata(hdev);

/* Sixaxis HID report has acclerometers/gyro with MSByte first, this
* has to be BYTE_SWAPPED before passing up to joystick interface
*/
if ((sc->quirks & (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)) &&
rd[0] == 0x01 && size == 49) {
swap(rd[41], rd[42]);
swap(rd[43], rd[44]);
swap(rd[45], rd[46]);
swap(rd[47], rd[48]);
}

return 0;
}

/*
* The Sony Sixaxis does not handle HID Output Reports on the Interrupt EP
* like it should according to usbhid/hid-core.c::usbhid_output_raw_report()
Expand Down Expand Up @@ -209,6 +228,7 @@ static struct hid_driver sony_driver = {
.probe = sony_probe,
.remove = sony_remove,
.report_fixup = sony_report_fixup,
.raw_event = sony_raw_event
};

static int __init sony_init(void)
Expand Down

0 comments on commit b06d3c0

Please sign in to comment.