Linux bluetooth development
 help / color / mirror / Atom feed
From: Frank Praznik <frank.praznik@oh.rr.com>
To: linux-bluetooth@vger.kernel.org
Cc: dh.herrmann@gmail.com, simon@mungewell.org,
	Frank Praznik <frank.praznik@oh.rr.com>
Subject: [PATCH 1/1] HIDP: Add a special case for the Dualshock 4
Date: Mon, 20 Jan 2014 18:37:02 -0500	[thread overview]
Message-ID: <1390261022-3113-2-git-send-email-frank.praznik@oh.rr.com> (raw)
In-Reply-To: <1390261022-3113-1-git-send-email-frank.praznik@oh.rr.com>

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


      reply	other threads:[~2014-01-20 23:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390261022-3113-2-git-send-email-frank.praznik@oh.rr.com \
    --to=frank.praznik@oh.rr.com \
    --cc=dh.herrmann@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=simon@mungewell.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox