From patchwork Sat Feb 25 01:21:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicki Pfau X-Patchwork-Id: 13151983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3902DC7EE2E for ; Sat, 25 Feb 2023 01:22:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229547AbjBYBWW (ORCPT ); Fri, 24 Feb 2023 20:22:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbjBYBWV (ORCPT ); Fri, 24 Feb 2023 20:22:21 -0500 Received: from endrift.com (endrift.com [173.255.198.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7863A268F for ; Fri, 24 Feb 2023 17:22:20 -0800 (PST) Received: from nebulosa.vulpes.eutheria.net (unknown [50.47.218.115]) by endrift.com (Postfix) with ESMTPSA id 3DCACA287; Fri, 24 Feb 2023 17:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=endrift.com; s=2020; t=1677288139; bh=qXiKKWdMYrPQhe+7l0MH5GFPgrW9w+HJp40BLJqp31I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cxDvc+xErqekqLwE/krIQqcUSkDUq/D0LR7rKSMps6p0y2q0e6LKfJH6L1+I2U6E8 703sMwEVUT1eEG+L/sX8/NLYCK1N5VITs/AODWL5rEV62jV4fW9fzj9IYyXxHaHOvs 9kO3Fo5cVwD223RQqfJKjCetvtzSeIVfKVEOwqT8ZsH6meoBvr8Z3jep+A9gH0py44 SFbkjPSqR9agC5QNDDyAfQJ5MKLAxtACUO8GssKkWTUU6yloFs0t8cvP+rX1nda5Ko em38Qpz5pHMJJUZ+FpEOnWgIEmuaj4SWE3sUIVa7FOGHuDHJuyiNDK3eWnhJ4WKnA2 pQX3eU87aOS/g== From: Vicki Pfau To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, Pavel Rojtberg Cc: Vicki Pfau , Andrey Smirnov Subject: [PATCH 1/3] Input: xpad - fix support for some third-party controllers Date: Fri, 24 Feb 2023 17:21:46 -0800 Message-Id: <20230225012147.276489-2-vi@endrift.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230225012147.276489-1-vi@endrift.com> References: <20230225012147.276489-1-vi@endrift.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch and Gamesir-G3w, require a specific packet that the first-party XInput driver sends before it will start sending reports. It's not currently known what this packet does, but since the first-party driver always sends it's unlikely that this could cause issues with existing controllers. Co-authored-by: Andrey Smirnov Signed-off-by: Vicki Pfau --- drivers/input/joystick/xpad.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 403b57e8176b..04af2213407f 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -265,6 +265,7 @@ static const struct xpad_device { { 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE }, { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, { 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, + { 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX }, { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX }, { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, @@ -2020,6 +2021,27 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id goto err_free_in_urb; } + if (xpad->xtype == XTYPE_XBOX360) { + /* Some third-party controllers Xbox 360-style controllers + * require this message to finish initialization */ + uint8_t dummy[20]; + int ret; + + usb_control_msg_recv(udev, 0, + /* bRequest */ 0x01, + /* bmRequestType */ + USB_TYPE_VENDOR | USB_DIR_IN | + USB_RECIP_INTERFACE, + /* wValue */ 0x100, + /* wIndex */ 0x00, + dummy, sizeof(dummy), + 25, + GFP_KERNEL); + if (ret) + dev_warn(&xpad->dev->dev, + "unable to receive magic message: %d\n", ret); + } + ep_irq_in = ep_irq_out = NULL; for (i = 0; i < 2; i++) { From patchwork Sat Feb 25 01:21:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicki Pfau X-Patchwork-Id: 13151985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E16F1C6FA8E for ; Sat, 25 Feb 2023 01:22:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229496AbjBYBWW (ORCPT ); Fri, 24 Feb 2023 20:22:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjBYBWV (ORCPT ); Fri, 24 Feb 2023 20:22:21 -0500 Received: from endrift.com (endrift.com [173.255.198.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D8A5583 for ; Fri, 24 Feb 2023 17:22:20 -0800 (PST) Received: from nebulosa.vulpes.eutheria.net (unknown [50.47.218.115]) by endrift.com (Postfix) with ESMTPSA id E010FA2AC; Fri, 24 Feb 2023 17:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=endrift.com; s=2020; t=1677288140; bh=MehVff0Xk6uIWCLJaKhlDyABzpbF7sin7qcyCjdoHhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NkTXvKPqPvWO3hj5HayZNbzz/RG7oFCdxs4ioqM0HCjkaIeS739/iCX2nsNFQ2Z1m g7oWRKjn0J+AC1oRBug1UqUTzsZI56sadYmodmH8gdEM/n1xSvOTaxusXSgKcQrBEj yat8Y+LZotSuvS2SWJhFOBjtxmp/cGm0VbQLG1ruzqhNzfSUe9jDap70nWJH4La1s6 OY64eti9pE1zpwn5eN8t3r/2bWTdQLxW76Sjb+8wNht0/tyRLV1gAX7kkMYADvk8y8 VJEcdUbvDLb54EGC9MZyG4WXzAA02D1EFNuLZqBx48DzMPy+wwFSc3lWMDqS3vB2Cw kxfsvqydKZciQ== From: Vicki Pfau To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, Pavel Rojtberg Cc: Vicki Pfau Subject: [PATCH 2/3] Input: xpad - remove unused field in VID/PID table Date: Fri, 24 Feb 2023 17:21:47 -0800 Message-Id: <20230225012147.276489-3-vi@endrift.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230225012147.276489-1-vi@endrift.com> References: <20230225012147.276489-1-vi@endrift.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The list of specific VID/PID combinations for various controllers recently added a new field "xtype". However, this field isn't used, nor filled in in the table itself, and was likely added by mistake and overlooked during review. Since this field isn't used, it's safe to remove. Signed-off-by: Vicki Pfau --- drivers/input/joystick/xpad.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 04af2213407f..d244ba22b85e 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -126,7 +126,6 @@ static const struct xpad_device { char *name; u8 mapping; u8 xtype; - u8 packet_type; } xpad_device[] = { { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 }, { 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 }, From patchwork Sat Feb 25 01:21:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicki Pfau X-Patchwork-Id: 13151984 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57966C7EE30 for ; Sat, 25 Feb 2023 01:22:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229527AbjBYBWX (ORCPT ); Fri, 24 Feb 2023 20:22:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjBYBWW (ORCPT ); Fri, 24 Feb 2023 20:22:22 -0500 Received: from endrift.com (endrift.com [173.255.198.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FF7F268F for ; Fri, 24 Feb 2023 17:22:21 -0800 (PST) Received: from nebulosa.vulpes.eutheria.net (unknown [50.47.218.115]) by endrift.com (Postfix) with ESMTPSA id 78223A2B0; Fri, 24 Feb 2023 17:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=endrift.com; s=2020; t=1677288140; bh=0lHvOQva6jtWeKfNQP6ApmewXX19YHK86Cmr2ipzgFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yYhNR9wU8wTSivaXL7fYL6Sq0GDV1Tbn3kk4CXi6FBAoBottpi11Q83t044S1l5jQ wCE0K9vqiEQsvhbvxb07I/KtKUVAPSF97BoA859ME9CnBk4UQnW2G4X70Mbw368sL9 lG4GGC30F5LHvCl6TR7808oFzG8N9XvsqzzlPfW7vmJQL10rHNs5TEu9iVglXUXpjp ktdEf8yXai8H6mgKRX7y96O6D8In76dS74pUxEXCgKX/HgtW21Y2kgScvZmrdIwlXf BGJzUeIHTyQJyBOVHSzlTgVla3H+VxkcV2DaC5KSuyYtqcxX2S2aqmHPMezbXCjVwK oQ6sDZK2aEjww== From: Vicki Pfau To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, Pavel Rojtberg Cc: Vicki Pfau Subject: [PATCH 3/3] Input: xpad - Add VID for Turtle Beach controllers Date: Fri, 24 Feb 2023 17:21:48 -0800 Message-Id: <20230225012147.276489-4-vi@endrift.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230225012147.276489-1-vi@endrift.com> References: <20230225012147.276489-1-vi@endrift.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This adds support for the Turtle Beach REACT-R and Recon Xbox controllers Signed-off-by: Vicki Pfau --- drivers/input/joystick/xpad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index d244ba22b85e..a4f9a21f1355 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -475,6 +475,7 @@ static const struct usb_device_id xpad_table[] = { XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */ XPAD_XBOX360_VENDOR(0x1038), /* SteelSeries Controllers */ + XPAD_XBOXONE_VENDOR(0x10f5), /* Turtle Beach Controllers */ XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */ XPAD_XBOX360_VENDOR(0x1209), /* Ardwiino Controllers */ XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */