Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions drivers/hid/hid-sony.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,27 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
static int sixaxis_set_operational_bt(struct hid_device *hdev)
{
unsigned char buf[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
return hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),
HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
unsigned char ack;
unsigned char enable_gasia[] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declaring a variable here will cause a compiler warning. It needs to be declared at the beginning with the rest of the variables.

0xA2,
0x01,
0x00, 0x00, 0x00, 0x00, 0x00, /* rumble values [0x00, right-timeout, right-force, left-timeout, left-force] */
0x00, 0x00, 0x00, 0x00, 0x02, /* 0x02=LED1 .. 0x10=LED4 */
0xff, 0x27, 0x10, 0x00, 0x32, /* LED 4 */
0xff, 0x27, 0x10, 0x00, 0x32, /* LED 3 */
0xff, 0x27, 0x10, 0x00, 0x32, /* LED 2 */
0xff, 0x27, 0x10, 0x00, 0x32, /* LED 1 */
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00
};

ack = hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf), HID_FEATURE_REPORT, HID_REQ_SET_REPORT);

hid_hw_raw_request(hdev, enable_gasia[0], enable_gasia, sizeof(enable_gasia), HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we send this request to a controller that does not support it? Do we get a bad ack value?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this doesn't matter since you don't have ack = here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hack is based on https://github.com/supertypo/qtsixa/commit/bbcc5c36d1f317509c39e9e84e77599fea4d81ed
I've only tested it with Gasia (fake PS3) joystick.
ack needs to be returned for original dualshock (see sony_probe)


return ack;
}

/*
Expand Down