From patchwork Wed Jan 9 01:18:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongye Yuan X-Patchwork-Id: 10753275 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D7DE13BF for ; Wed, 9 Jan 2019 01:18:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19E6128DDC for ; Wed, 9 Jan 2019 01:18:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09DA728DE5; Wed, 9 Jan 2019 01:18:32 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 AEA4728DDC for ; Wed, 9 Jan 2019 01:18:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728854AbfAIBSb (ORCPT ); Tue, 8 Jan 2019 20:18:31 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40546 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728835AbfAIBSb (ORCPT ); Tue, 8 Jan 2019 20:18:31 -0500 Received: by mail-pl1-f196.google.com with SMTP id u18so2748323plq.7 for ; Tue, 08 Jan 2019 17:18:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/y0mlt16gmxTOJwgnHyvBaONSQ5EQu+h0C2qU/wSqaY=; b=dnTV4QDotyVbXYF6sPvxcyU5oCpBVw+PiK9seklSkihclQorgEJ2abx43EL6LVe9bC xOb0Vjp9oaGjGE7dEtZZE3yHtQV6Y83JHqiDDFLmMZhD9YHXRzvNl1CnnG/DL4C6yp5y PSJHdHc7QEITCPlM8G/WcMX1vbLn4m4C/Kx7ZKQJT7/Z9SLnyfApFdQOQPLU6TI05E+R BmdkjaAYOEXI3Prns524udQs/WxhZZqzZLvkynilUEXeMXphvtpnK2MuQjyNyzgaEHgr oflw+pvf17rJkj/nl/y9bh+UUR7xPQQ/BerpxAMltxhxcXdIuk7fEVGuRTjoL0ojEjFL IfDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/y0mlt16gmxTOJwgnHyvBaONSQ5EQu+h0C2qU/wSqaY=; b=XC80TdepvLJbcArVLIqrjmQUbozF+aFhEzJd6U3Rd5D/C3oIWQ6J/TdmqZRQjqzr6U tXSe6r/05Hmg2Oz4KqEVJvXVA35Lyb8gCb343eCSU1RPkZAaP2TRfdoyR5M+61zQjfNn LoZmyaVgv47j3/840IAanI3Gbz6FQhR+KQUM84liSReMFVrxBqsBvmVOhm1hjEG22M7t 61bdiGxsQWtEw7zGoAeHf78K0PAxoeg7wVxh9dmN3h9zYfqyX4jV4dk9Dg3yRFQe/+/n hfgvMvgsOpuo1+Wyxdq9LvMYx7I+y+7EvMtu1BU6KPyCK5btIwCuI7J1w45I90yaYOJN WgeQ== X-Gm-Message-State: AJcUukcg2YPnzO89D9mrkpGVsle8ozXX9TKWMeruopLUh33WuIyILrCU gdTHAvSrXoGI6OioEOpupydl+Jn2OFo= X-Google-Smtp-Source: ALg8bN4KvhbOTaU4+Vk84vzaMJxiib//yGDfuwYo8hidd7lfFceK1itG0efY72NhoNki1+MNUK60uA== X-Received: by 2002:a17:902:830a:: with SMTP id bd10mr4032771plb.321.1546996710073; Tue, 08 Jan 2019 17:18:30 -0800 (PST) Received: from localhost ([45.77.70.206]) by smtp.gmail.com with ESMTPSA id p2sm97732209pfb.28.2019.01.08.17.18.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 17:18:29 -0800 (PST) From: Hongye Yuan To: linux-input@vger.kernel.org Cc: jikos@kernel.org, hadess@hadess.net, benjamin.tissoires@redhat.com, rydberg@bitmath.org, roderick.colenbrander@sony.com, ao2@ao2.it, Hongye Yuan Subject: [PATCH v4 2/2] HID: sony: Fix SHANWAN PS3 GamePad rumble and led settings support Date: Wed, 9 Jan 2019 09:18:09 +0800 Message-Id: <20190109011809.16542-2-outmatch@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190109011809.16542-1-outmatch@gmail.com> References: <20190109011809.16542-1-outmatch@gmail.com> MIME-Version: 1.0 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 Rumble support on SHANWAN PS3 gamepad is not working when a user program has asked it to. If a HID Output Reports is sent via Control Channel then it will be discard by gamepad, thus rumble motor and led settings in Output Report are ignored. This patch therefore sends HID Output Report via Interrupt Channel to SHANWAN gamepad instead of Control Channel, fixing rumble motor and led settings. Signed-off-by: Hongye Yuan Reviewed-by: Bastien Nocera --- Changes in v4: - Explain what this patch fixes in detail. --- drivers/hid/hid-sony.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index fc82f02bae75..26fae90b931a 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -2100,9 +2100,14 @@ static void sixaxis_send_output_report(struct sony_sc *sc) } } - hid_hw_raw_request(sc->hdev, report->report_id, (u8 *)report, - sizeof(struct sixaxis_output_report), - HID_OUTPUT_REPORT, HID_REQ_SET_REPORT); + /* SHANWAN controllers require output reports via intr channel */ + if (sc->quirks & SHANWAN_GAMEPAD) + hid_hw_output_report(sc->hdev, (u8 *)report, + sizeof(struct sixaxis_output_report)); + else + hid_hw_raw_request(sc->hdev, report->report_id, (u8 *)report, + sizeof(struct sixaxis_output_report), + HID_OUTPUT_REPORT, HID_REQ_SET_REPORT); } static void dualshock4_send_output_report(struct sony_sc *sc)