Skip to content

Commit 41d2d42

Browse files
mungewellJiri Kosina
authored andcommitted
HID: sony: PS3 Move enable LEDs and Rumble via BT
The LED and Rumble control only function via BT if the full output report is sent. The large report still functions via USB. Signed-off-by: Simon Wood <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 12e9a6d commit 41d2d42

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/hid/hid-sony.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ struct motion_output_report_02 {
902902
#define DS4_REPORT_0x81_SIZE 7
903903
#define SIXAXIS_REPORT_0xF2_SIZE 17
904904
#define SIXAXIS_REPORT_0xF5_SIZE 8
905+
#define MOTION_REPORT_0x02_SIZE 49
905906

906907
static DEFINE_SPINLOCK(sony_dev_list_lock);
907908
static LIST_HEAD(sony_device_list);
@@ -1746,7 +1747,7 @@ static void motion_state_worker(struct work_struct *work)
17461747
struct motion_output_report_02 *report =
17471748
(struct motion_output_report_02 *)sc->output_report_dmabuf;
17481749

1749-
memset(report, 0, sizeof(struct motion_output_report_02));
1750+
memset(report, 0, MOTION_REPORT_0x02_SIZE);
17501751

17511752
report->type = 0x02; /* set leds */
17521753
report->r = sc->led_state[0];
@@ -1757,8 +1758,7 @@ static void motion_state_worker(struct work_struct *work)
17571758
report->rumble = max(sc->right, sc->left);
17581759
#endif
17591760

1760-
hid_hw_output_report(hdev, (__u8 *)report,
1761-
sizeof(struct motion_output_report_02));
1761+
hid_hw_output_report(hdev, (__u8 *)report, MOTION_REPORT_0x02_SIZE);
17621762
}
17631763

17641764
static int sony_allocate_output_report(struct sony_sc *sc)
@@ -1774,9 +1774,8 @@ static int sony_allocate_output_report(struct sony_sc *sc)
17741774
sc->output_report_dmabuf = kmalloc(DS4_REPORT_0x05_SIZE,
17751775
GFP_KERNEL);
17761776
else if (sc->quirks & MOTION_CONTROLLER)
1777-
sc->output_report_dmabuf =
1778-
kmalloc(sizeof(struct motion_output_report_02),
1779-
GFP_KERNEL);
1777+
sc->output_report_dmabuf = kmalloc(MOTION_REPORT_0x02_SIZE,
1778+
GFP_KERNEL);
17801779
else
17811780
return 0;
17821781

0 commit comments

Comments
 (0)