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