[PATCH] Bluetooth: hidp: sixaxis dualshock report via ctrl quirk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: vivek <vivek@xxxxxxxxxxxxx>

The Sixaxis and Dualshock 4 wants report sent via the ctrl channel.

This patch has been used in the SteamOS kernel for a while now.
<https://github.com/ValveSoftware/steamos_kernel/commit/6e215b67a13c85d0cf5a9e0970acd9df7d2b77bd>

Signed-off-by: Vivek Das Mohapatra <vivek@xxxxxxxxxxxxx>
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@xxxxxxxxxxxxx>
---
 net/bluetooth/hidp/core.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 1036e4fa1ea2..fa75da91a559 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -379,9 +379,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,
-- 
2.16.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux