From patchwork Wed Jun 7 01:28:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicki Pfau X-Patchwork-Id: 690695 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 63321C7EE37 for ; Wed, 7 Jun 2023 01:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234753AbjFGB2p (ORCPT ); Tue, 6 Jun 2023 21:28:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240280AbjFGB2o (ORCPT ); Tue, 6 Jun 2023 21:28:44 -0400 Received: from endrift.com (endrift.com [173.255.198.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F9919A2 for ; Tue, 6 Jun 2023 18:28:43 -0700 (PDT) Received: from nebulosa.vulpes.eutheria.net (unknown [50.47.218.115]) by endrift.com (Postfix) with ESMTPSA id 88934A285; Tue, 6 Jun 2023 18:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=endrift.com; s=2020; t=1686101323; bh=+M7n4ey9uKv4vHkOJZq6g4KxBpSYAYh7nhSQWjqIJKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W9si24tuoZIbyRZVPapg3qqoKAZrLSx02WEkVYBVKAf0FqxopOFiAooUyQKjoveVS /fhvZ1M2HeaW6a8wDTpVTyylXwfkhV5JC1NfSFezQbU+CdGMpnex/WAiKkKUH4znCN jFXMRZ7yAukEwCtqjtB+TXj5Ng3vYFNBR/rGUeyflx80YA2cCTcLuJGFq9PRc8wme0 dj/0Ubl80FSFVoYElkAuNvj4sn2r907T4sRfb/79eoSUIq9rcfN2k84jh53Fpp0zvc ZFB0V1XTRrXsh3cOuZodged15x4QIbOSZxB2Wivjvmel+7MvT5LFbHoPTBI5k32UiZ 6i3Tw4tPXYzUA== From: Vicki Pfau To: Dmitry Torokhov , linux-input@vger.kernel.org Cc: Vicki Pfau , Pavel Rojtberg , Andrey Smirnov Subject: [PATCH 1/2] Input: xpad - fix support for some third-party controllers Date: Tue, 6 Jun 2023 18:28:11 -0700 Message-Id: <20230607012812.379640-2-vi@endrift.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607012812.379640-1-vi@endrift.com> References: <20230607012812.379640-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 5d6a25b42bf9..745047215e42 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -264,6 +264,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 }, @@ -1720,6 +1721,27 @@ static int xpad_start_input(struct usb_xpad *xpad) return error; } } + if (xpad->xtype == XTYPE_XBOX360) { + /* + * Some third-party controllers Xbox 360-style controllers + * require this message to finish initialization. + */ + u8 dummy[20]; + + error = usb_control_msg_recv(xpad->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 (error) + dev_warn(&xpad->dev->dev, + "unable to receive magic message: %d\n", + error); + } return 0; } From patchwork Wed Jun 7 01:28:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicki Pfau X-Patchwork-Id: 690694 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 0C453C7EE2F for ; Wed, 7 Jun 2023 01:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240280AbjFGB2q (ORCPT ); Tue, 6 Jun 2023 21:28:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240383AbjFGB2o (ORCPT ); Tue, 6 Jun 2023 21:28:44 -0400 Received: from endrift.com (endrift.com [173.255.198.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 514EB19AB for ; Tue, 6 Jun 2023 18:28:44 -0700 (PDT) Received: from nebulosa.vulpes.eutheria.net (unknown [50.47.218.115]) by endrift.com (Postfix) with ESMTPSA id 27C57A29D; Tue, 6 Jun 2023 18:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=endrift.com; s=2020; t=1686101323; bh=64DKrYCpzykZvpU+00jat8F30txAV21MDf4b9l1LmsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HKc4XjaddZ/C5VV6PD//dPzaEUiT9Msa/wiG5/1llkHc98Mw8/aDR1h80SGdwmoMw LPUBcaOvcDpmXfFMhLnnjy+/AwHdxnvTX0yhiZo4sN0bR3rv01p/FVRfF8tbuJJMDJ noxYQeTdBaRWrrtP8TWAyK7DOZGAxYTQiAI08PanMZd4Fwo1pGkld5J+yIb+o8dg6g GCn7CYImCjxUIry3Ocj9VFi/9vXibPXyFx0m2fWWczpf9l6q8gMg9TkVpXSKLTMK8H LAOBhCAu02LBloNvTE+MBT1a0Bd1F38zQj9w5Xmvf/LOBkQmo1pa/shuCMwmjyTAHc jaj47QjeHiB0g== From: Vicki Pfau To: Dmitry Torokhov , linux-input@vger.kernel.org Cc: Sam Lantinga , Pavel Rojtberg , Vicki Pfau Subject: [PATCH 2/2] Input: xpad - Add GameSir VID for Xbox One controllers Date: Tue, 6 Jun 2023 18:28:12 -0700 Message-Id: <20230607012812.379640-3-vi@endrift.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607012812.379640-1-vi@endrift.com> References: <20230607012812.379640-1-vi@endrift.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Sam Lantinga Signed-off-by: Sam Lantinga 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 745047215e42..459b5c507399 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -499,6 +499,7 @@ static const struct usb_device_id xpad_table[] = { XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */ XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke Xbox One pad */ XPAD_XBOX360_VENDOR(0x2f24), /* GameSir controllers */ + XPAD_XBOXONE_VENDOR(0x3537), /* GameSir Controllers */ XPAD_XBOX360_VENDOR(0x31e3), /* Wooting Keyboards */ XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */ { }