* [PATCH 0/1] HIDP: Add a special case for the Dualshock 4
@ 2014-01-20 23:37 Frank Praznik
2014-01-20 23:37 ` [PATCH 1/1] " Frank Praznik
0 siblings, 1 reply; 2+ messages in thread
From: Frank Praznik @ 2014-01-20 23:37 UTC (permalink / raw)
To: linux-bluetooth; +Cc: dh.herrmann, simon
This adds a special case in the HIDP core for the Dualshock 4 controller.
The controller only recognizes output reports with the report type 0x52 and
only accepts reports sent via the ctrl channel.
Unfortunately, this was the only way I could send data to the controller. I
looked around for alternatives, but adding a special case to the HIDP system
seemed to be the only way. If there is a way to set a custom report type and
specify the channel without polluting the core with a device specific quirk
I'll gladly use it.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] HIDP: Add a special case for the Dualshock 4
2014-01-20 23:37 [PATCH 0/1] HIDP: Add a special case for the Dualshock 4 Frank Praznik
@ 2014-01-20 23:37 ` Frank Praznik
0 siblings, 0 replies; 2+ messages in thread
From: Frank Praznik @ 2014-01-20 23:37 UTC (permalink / raw)
To: linux-bluetooth; +Cc: dh.herrmann, simon, Frank Praznik
The Dualshock 4 wants reports with type 0x52 sent on the ctrlchannel when
running over bluetooth. This adds a special case so that the reports can
be successfully sent.
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
---
net/bluetooth/hidp/core.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 292e619..e597e3f 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -360,9 +360,17 @@ static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, s
int ret;
if (report_type == HID_OUTPUT_REPORT) {
- report_type = HIDP_TRANS_DATA | HIDP_DATA_RTYPE_OUPUT;
- return hidp_send_intr_message(session, report_type,
+ /* The Dualshock 4 wants report type 0x52 sent via the ctrl channel */
+ if(hid->vendor == 0x54c && hid->product == 0x5c4) {
+ report_type = HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_OUPUT;
+ return hidp_send_ctrl_message(session, report_type,
data, count);
+ }
+ else {
+ report_type = HIDP_TRANS_DATA | HIDP_DATA_RTYPE_OUPUT;
+ return hidp_send_intr_message(session, report_type,
+ data, count);
+ }
} else if (report_type != HID_FEATURE_REPORT) {
return -EINVAL;
}
--
1.8.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-20 23:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 23:37 [PATCH 0/1] HIDP: Add a special case for the Dualshock 4 Frank Praznik
2014-01-20 23:37 ` [PATCH 1/1] " Frank Praznik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox