From patchwork Tue Nov 7 14:24:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 10046773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF8B16031B for ; Tue, 7 Nov 2017 14:25:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A30B62943C for ; Tue, 7 Nov 2017 14:25:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 956C729B94; Tue, 7 Nov 2017 14:25:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E024929B78 for ; Tue, 7 Nov 2017 14:25:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753962AbdKGOZM (ORCPT ); Tue, 7 Nov 2017 09:25:12 -0500 Received: from slow1-d.mail.gandi.net ([217.70.178.86]:37345 "EHLO slow1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751875AbdKGOZL (ORCPT ); Tue, 7 Nov 2017 09:25:11 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id 4B97447F5FD; Tue, 7 Nov 2017 15:24:51 +0100 (CET) X-Originating-IP: 83.155.44.161 Received: from classic.redhat.com (mon69-7-83-155-44-161.fbx.proxad.net [83.155.44.161]) (Authenticated sender: hadess@hadess.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 9F88FA80F9; Tue, 7 Nov 2017 15:24:48 +0100 (CET) From: Bastien Nocera To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jiri Kosina , Szymon Janc , Bastien Nocera Subject: [PATCH] HID: sony: Fix SHANWAN pad rumbling on USB Date: Tue, 7 Nov 2017 15:24:47 +0100 Message-Id: <20171107142447.11810-1-hadess@hadess.net> X-Mailer: git-send-email 2.14.3 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SHANWAN PS3 clone joypad will start its rumble motors as soon as it is plugged in via USB. As the additional USB interrupt does nothing on the original PS3 Sixaxis joypads, and makes a number of other clone joypads actually start sending data, disable that call for the SHANWAN so the rumble motors aren't started on plug. Signed-off-by: Bastien Nocera Tested-by: Szymon Janc --- drivers/hid/hid-sony.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index d03203a82e8f..b9dc3ac4d4aa 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1439,10 +1439,16 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev) goto out; } - ret = hid_hw_output_report(hdev, buf, 1); - if (ret < 0) { - hid_info(hdev, "can't set operational mode: step 3, ignoring\n"); - ret = 0; + /* + * But the USB interrupt would cause SHANWAN controllers to + * start rumbling non-stop. + */ + if (strcmp(hdev->name, "SHANWAN PS3 GamePad")) { + ret = hid_hw_output_report(hdev, buf, 1); + if (ret < 0) { + hid_info(hdev, "can't set operational mode: step 3, ignoring\n"); + ret = 0; + } } out: