Skip to content

Commit b71b557

Browse files
KontrabantJiri Kosina
authored andcommitted
HID: sony: Remove the size check for the Dualshock 4 HID Descriptor
Sony has modified the HID descriptor in new revisions of the Dualshock 4 which causes the size check in the descriptor replacement function to fail. Remove it so that new revisions of the controller will work correctly. The module is completely replacing the descriptor instead of patching it, so the size check isn't really necessary anyways. Signed-off-by: Frank Praznik <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent decd946 commit b71b557

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-sony.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,11 +1139,11 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
11391139
* the gyroscope values to corresponding axes so we need a
11401140
* modified one.
11411141
*/
1142-
if ((sc->quirks & DUALSHOCK4_CONTROLLER_USB) && *rsize == 467) {
1142+
if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) {
11431143
hid_info(hdev, "Using modified Dualshock 4 report descriptor with gyroscope axes\n");
11441144
rdesc = dualshock4_usb_rdesc;
11451145
*rsize = sizeof(dualshock4_usb_rdesc);
1146-
} else if ((sc->quirks & DUALSHOCK4_CONTROLLER_BT) && *rsize == 357) {
1146+
} else if (sc->quirks & DUALSHOCK4_CONTROLLER_BT) {
11471147
hid_info(hdev, "Using modified Dualshock 4 Bluetooth report descriptor\n");
11481148
rdesc = dualshock4_bt_rdesc;
11491149
*rsize = sizeof(dualshock4_bt_rdesc);

0 commit comments

Comments
 (0)