3cf9b07
From 954d6154959c8c196fa4b89fc98a4fb377c6a38d Mon Sep 17 00:00:00 2001
3cf9b07
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
3cf9b07
Date: Fri, 8 Jan 2016 17:58:49 +0100
3cf9b07
Subject: [PATCH] HID: sony: do not bail out when the sixaxis refuses the
3cf9b07
 output report
3cf9b07
3cf9b07
When setting the operational mode, some third party (Speedlink Strike-FX)
3cf9b07
gamepads refuse the output report. Failing here means we refuse to
3cf9b07
initialize the gamepad while this should be harmless.
3cf9b07
3cf9b07
The weird part is that the initial commit that added this: a7de9b8
3cf9b07
("HID: sony: Enable Gasia third-party PS3 controllers") mentions this
3cf9b07
very same controller as one requiring this output report.
3cf9b07
Anyway, it's broken for one user at least, so let's change it.
3cf9b07
We will report an error, but at least the controller should work.
3cf9b07
3cf9b07
And no, these devices present themselves as legacy Sony controllers
3cf9b07
(VID:PID of 054C:0268, as in the official ones) so there are no ways
3cf9b07
of discriminating them from the official ones.
3cf9b07
3cf9b07
https://bugzilla.redhat.com/show_bug.cgi?id=1255325
3cf9b07
3cf9b07
Reported-and-tested-by: Max Fedotov <thesourcehim@gmail.com>
3cf9b07
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
3cf9b07
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3cf9b07
---
3cf9b07
 drivers/hid/hid-sony.c | 6 ++++--
3cf9b07
 1 file changed, 4 insertions(+), 2 deletions(-)
3cf9b07
3cf9b07
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
3cf9b07
index 661f94f8ab8b..11f91c0c2458 100644
3cf9b07
--- a/drivers/hid/hid-sony.c
3cf9b07
+++ b/drivers/hid/hid-sony.c
3cf9b07
@@ -1411,8 +1411,10 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
3cf9b07
 	}
3cf9b07
 
3cf9b07
 	ret = hid_hw_output_report(hdev, buf, 1);
3cf9b07
-	if (ret < 0)
3cf9b07
-		hid_err(hdev, "can't set operational mode: step 3\n");
3cf9b07
+	if (ret < 0) {
3cf9b07
+		hid_info(hdev, "can't set operational mode: step 3, ignoring\n");
3cf9b07
+		ret = 0;
3cf9b07
+	}
3cf9b07
 
3cf9b07
 out:
3cf9b07
 	kfree(buf);
3cf9b07
-- 
3cf9b07
2.5.0
3cf9b07