summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Praznik <frank.praznik@gmail.com>2015-11-06 15:35:53 -0500
committerSiarhei Vishniakou <svv@google.com>2019-11-07 11:12:01 -0600
commit3747324fca890d0f445bc7663262aeeff1815f72 (patch)
treeba57fac026c6fbef0775c926d104aa51c9bd672e
parentf594dbc70fc32474f5bbba1c9090b941cf074511 (diff)
UPSTREAM: 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 <frank.praznik@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> (cherry picked from commit b71b5578a84d297954e4812ba0ca2d466e61cf42) Bug: 111431828 Signed-off-by: Kim Low <kim-huei.low@sony.com> Change-Id: Idad96e31466c4d36533f79b55768f3a98213a3c9 Signed-off-by: Siarhei Vishniakou <svv@google.com>
-rw-r--r--drivers/hid/hid-sony.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b278fe6dbea9..94be9b18e1e3 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -1139,11 +1139,11 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
* the gyroscope values to corresponding axes so we need a
* modified one.
*/
- if ((sc->quirks & DUALSHOCK4_CONTROLLER_USB) && *rsize == 467) {
+ if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) {
hid_info(hdev, "Using modified Dualshock 4 report descriptor with gyroscope axes\n");
rdesc = dualshock4_usb_rdesc;
*rsize = sizeof(dualshock4_usb_rdesc);
- } else if ((sc->quirks & DUALSHOCK4_CONTROLLER_BT) && *rsize == 357) {
+ } else if (sc->quirks & DUALSHOCK4_CONTROLLER_BT) {
hid_info(hdev, "Using modified Dualshock 4 Bluetooth report descriptor\n");
rdesc = dualshock4_bt_rdesc;
*rsize = sizeof(dualshock4_bt_rdesc);