From patchwork Sat Dec 9 22:26:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Furneaux X-Patchwork-Id: 10103825 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 F083260325 for ; Sat, 9 Dec 2017 23:01:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D61592916B for ; Sat, 9 Dec 2017 23:01:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C813B291E3; Sat, 9 Dec 2017 23:01:22 +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.9 required=2.0 tests=BAYES_00,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 3C7832916B for ; Sat, 9 Dec 2017 23:01:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751290AbdLIXBR (ORCPT ); Sat, 9 Dec 2017 18:01:17 -0500 Received: from outbound21.reliablemail.org ([173.236.90.21]:41825 "EHLO outbound21.reliablemail.org" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751263AbdLIXBQ (ORCPT ); Sat, 9 Dec 2017 18:01:16 -0500 X-Greylist: delayed 2097 seconds by postgrey-1.27 at vger.kernel.org; Sat, 09 Dec 2017 18:01:16 EST Received: from [184.154.46.16] (helo=pcluster12.stablehost.com) by filter03.reliabledns.org with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eNnZZ-0005fH-CB for linux-input@vger.kernel.org; Sat, 09 Dec 2017 15:26:18 -0700 Received: from cpe08d42b1fb123-cm788df7e09410.cpe.net.cable.rogers.com ([173.35.34.236]:54865 helo=furneaux.ca) by pcluster12.stablehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1eNnZX-003wZ7-HC; Sat, 09 Dec 2017 15:26:15 -0700 MIME-Version: 1.0 Date: Sat, 09 Dec 2017 17:26:15 -0500 From: Mark Furneaux To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org Subject: [PATCH] Input: Add support for PDP Xbox One controllers Message-ID: <1a12e3c57f22f67a63d26f45fd4d997f@furneaux.ca> X-Sender: mark@furneaux.ca User-Agent: Roundcube Webmail/1.2.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - pcluster12.stablehost.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - furneaux.ca X-Get-Message-Sender-Via: pcluster12.stablehost.com: authenticated_id: mark@furneaux.ca X-Authenticated-Sender: pcluster12.stablehost.com: mark@furneaux.ca X-Source: X-Source-Args: X-Source-Dir: X-Originating-IP: 184.154.46.16 X-SpamExperts-Domain: outgoing.reliabledns.org X-SpamExperts-Username: 184.154.46.16 Authentication-Results: reliabledns.org; auth=pass smtp.auth=184.154.46.16@outgoing.reliabledns.org X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: SB/global_tokens (0.000454641082942) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5mQOYFs/gXznK/sZhUVh27gXv9krsgRhBn0ayn6qsUc7bGFWXFtvoxcs yLJek5KJPOrkwOtxAS8PGBqPQnmkEPnGTeieozC56kHupXsZOaDGEfhnr4j2xZv1zIFjZz6ykjtV rcXiG3jVvyh9GTF9XU6Cu5+xn8wZE3UBya6qQ+FDfZqPs+b1TWjrdQK6f+1X63eMg/YUK0x6HmwH CNapmLvgvpnunQOsgZPpnjjHtFttCMKZw1tYrnr7rJHHUpEAaqg2HAG29ucnwP0M3OWpRjoXRuWz sGtazoE/vPfv1xaxiagz04q5AaWjEwacdK/02AXxHd6tfCgKxSc7jkftfJXcP1+oiRAyJTS82LRn ZNr6QSonZiFodgo9fgcdxbh+YirKlBJzmvmuVVPMmGAm2H4sifhPvHIkt3zYV/z7EHc3sFdeAnz4 j2Jd9hHlkVeQ3de5SQnMMyNtwELxWMVGvRU/2Jb+MUDCV6Z92vdi8cBprSOIPpeqwlm2NDGXIJ2x 7BiB/yUbknooj361IClN2rrkjw9aHs4ZRVaZ/kzIraHBe2lzyOamdn2lh8IdqVrbeX+eE1zbA6u+ mejcWDdayb7hYzb6k+scPOftG5Udbpt4XQLvP1E8Z2irF1Xzy6D8MM59pEPA/LupXnl0Gxo86qxe ULdhSPHgnOtMNwZwfhj27HSLWi9UjAWnijKCx633/DwJWw42swm4bO6gacpMpzLKRevmPeXLw1zp zoozXv8YiKaQ65SjqLMO03zVo5EnUP8HIoTrTYfhuuKgZrNyd219I6lUgRhwzqkVN1TKJOagapPq 0WKoJEfpiyUXMSUig1776tNJgaFTXff9lHy/v2qopXdgU3Cm2l/3/T6ju0sYPyTm/HzQYix8poDS MZ2+Ptc48WQnLkTV3oKBm1HkUJfC55CSW+yQHhGyilkQ9MazMS+4ayUpOtEhdxekWDmK9g== X-Report-Abuse-To: spam@filter01.reliabledns.org 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 [PATCH] Input: Add support for PDP Xbox One controllers Adds support for the current lineup of Xbox One controllers from PDP (Performance Designed Products). These controllers are very picky with their initialisation sequence and require an additional 2 packets before they send any input reports. Signed-off-by: mark@furneaux.ca --- drivers/input/joystick/xpad.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) { 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 }, { 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 }, @@ -476,6 +477,22 @@ static const u8 xboxone_hori_init[] = { }; /* + * This packet is required for some of the PDP pads to start + * sending input reports. One of those pads is (0x0e6f:0x02ab). + */ +static const u8 xboxone_pdp_init1[] = { + 0x0a, 0x20, 0x04, 0x03, 0x00, 0x01, 0x14 +}; + +/* + * This packet is required for some of the PDP pads to start + * sending input reports. One of those pads is (0x0e6f:0x02ab). + */ +static const u8 xboxone_pdp_init2[] = { + 0x06, 0x20, 0x01, 0x02, 0x01, 0x00 +}; + +/* * A specific rumble packet is required for some PowerA pads to start * sending input reports. One of those pads is (0x24c6:0x543a). */ @@ -504,7 +521,10 @@ static const u8 xboxone_rumbleend_init[] = { static const struct xboxone_init_packet xboxone_init_packets[] = { XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init), XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init), + XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_fw2015_init), XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init), + XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init1), + XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init2), XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init), XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init), XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init), -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index d86e595..5e76be2 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -229,6 +229,7 @@ static const struct xpad_device { { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, { 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, { 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015", 0, XTYPE_XBOXONE }, + { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE },