diff options
author | Frank Praznik <frank.praznik@oh.rr.com> | 2014-02-05 20:03:46 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-17 08:11:07 -0500 |
commit | fdcf105d3d96400fc6fb4b66b28fcff46a854326 (patch) | |
tree | a94be9b09b06ed864e207c6d90d68f88863b6498 /drivers/hid/hid-sony.c | |
parent | d829674d29d7eb99aeb3ad11eba61d06cda7aff4 (diff) |
HID: sony: Add Dualshock 4 Bluetooth output report formatting
Add formating for the Dualshock 4 output report data in Bluetooth mode.
In Bluetooth mode the Dualshock 4 wants output reports sent on the control
channel.
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r-- | drivers/hid/hid-sony.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 362fb45954ea..88401fc59886 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -1266,11 +1266,18 @@ static void dualshock4_state_worker(struct work_struct *work) | |||
1266 | struct hid_device *hdev = sc->hdev; | 1266 | struct hid_device *hdev = sc->hdev; |
1267 | int offset; | 1267 | int offset; |
1268 | 1268 | ||
1269 | __u8 buf[32] = { 0 }; | 1269 | __u8 buf[78] = { 0 }; |
1270 | 1270 | ||
1271 | buf[0] = 0x05; | 1271 | if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) { |
1272 | buf[1] = 0x03; | 1272 | buf[0] = 0x05; |
1273 | offset = 4; | 1273 | buf[1] = 0x03; |
1274 | offset = 4; | ||
1275 | } else { | ||
1276 | buf[0] = 0x11; | ||
1277 | buf[1] = 0xB0; | ||
1278 | buf[3] = 0x0F; | ||
1279 | offset = 6; | ||
1280 | } | ||
1274 | 1281 | ||
1275 | #ifdef CONFIG_SONY_FF | 1282 | #ifdef CONFIG_SONY_FF |
1276 | buf[offset++] = sc->right; | 1283 | buf[offset++] = sc->right; |
@@ -1283,7 +1290,11 @@ static void dualshock4_state_worker(struct work_struct *work) | |||
1283 | buf[offset++] = sc->led_state[1]; | 1290 | buf[offset++] = sc->led_state[1]; |
1284 | buf[offset++] = sc->led_state[2]; | 1291 | buf[offset++] = sc->led_state[2]; |
1285 | 1292 | ||
1286 | hid_hw_output_report(hdev, buf, sizeof(buf)); | 1293 | if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) |
1294 | hid_hw_output_report(hdev, buf, 32); | ||
1295 | else | ||
1296 | hid_hw_raw_request(hdev, 0x11, buf, 78, | ||
1297 | HID_OUTPUT_REPORT, HID_REQ_SET_REPORT); | ||
1287 | } | 1298 | } |
1288 | 1299 | ||
1289 | #ifdef CONFIG_SONY_FF | 1300 | #ifdef CONFIG_SONY_FF |