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