Skip to content

Commit

Permalink
Workaround for sending reports to the Sixaxis and DualShock 4.
Browse files Browse the repository at this point in the history
The Sixaxis and DualShock 4 want output reports sent on the control
channel when running on Bluetooth, so a special case is needed for them.

This is a bit of an ugly hack, but it gets the job done without needing to
backport the rather extensive HID system changes in newer kernels that are
needed to make these controllers function via Bluetooth.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
  • Loading branch information
Frank Praznik authored and vivek committed Jun 29, 2015
1 parent 747cffd commit 7d4732c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions net/bluetooth/hidp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,16 @@ static int hidp_output_report(struct hid_device *hid, __u8 *data, size_t count)
{
struct hidp_session *session = hid->driver_data;

return hidp_send_intr_message(session,
HIDP_TRANS_DATA | HIDP_DATA_RTYPE_OUPUT,
data, count);
/* The Sixaxis and Dualshock 4 wants report sent via the ctrl channel */
if(hid->vendor == 0x54c && (hid->product == 0x5c4 || hid->product == 0x268)) {
return hidp_send_ctrl_message(session,
HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_OUPUT,
data, count);
} else {
return hidp_send_intr_message(session,
HIDP_TRANS_DATA | HIDP_DATA_RTYPE_OUPUT,
data, count);
}
}

static int hidp_raw_request(struct hid_device *hid, unsigned char reportnum,
Expand Down

0 comments on commit 7d4732c

Please sign in to comment.