From mboxrd@z Thu Jan 1 00:00:00 1970 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 C9579C77B7E for ; Sun, 28 May 2023 19:18:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbjE1TSE (ORCPT ); Sun, 28 May 2023 15:18:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbjE1TSD (ORCPT ); Sun, 28 May 2023 15:18:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7CDF7 for ; Sun, 28 May 2023 12:17:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6188961A1E for ; Sun, 28 May 2023 19:17:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FE0FC433D2; Sun, 28 May 2023 19:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1685301476; bh=NlewJOv8ex2UPdvCvopsZ7X2dnQYkcPRexAAO0sTHEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=txq790bJr62k+Lcelomx3GYRXGxbwQ2t71+i4nxEyKXQl1i/eyqWUdK7TixXEdeZg Ym9/mzEaogKVDlINb5Wn/63t+KBExlTL3CWe6qotp3fUxrXagPKv2WEbLDn4oDCMvg nfk8bg6/qI2axi1+Nun/qPNF8N0RjXhsOleOHtYo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vicki Pfau , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.19 044/132] Input: xpad - add constants for GIP interface numbers Date: Sun, 28 May 2023 20:09:43 +0100 Message-Id: <20230528190834.926831834@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528190833.565872088@linuxfoundation.org> References: <20230528190833.565872088@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vicki Pfau [ Upstream commit f9b2e603c6216824e34dc9a67205d98ccc9a41ca ] Wired GIP devices present multiple interfaces with the same USB identification other than the interface number. This adds constants for differentiating two of them and uses them where appropriate Signed-off-by: Vicki Pfau Link: https://lore.kernel.org/r/20230411031650.960322-2-vi@endrift.com Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/joystick/xpad.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index c125cd42faee7..0a85f0817662a 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -503,6 +503,9 @@ struct xboxone_init_packet { } +#define GIP_WIRED_INTF_DATA 0 +#define GIP_WIRED_INTF_AUDIO 1 + /* * This packet is required for all Xbox One pads with 2015 * or later firmware installed (or present from the factory). @@ -1827,7 +1830,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id } if (xpad->xtype == XTYPE_XBOXONE && - intf->cur_altsetting->desc.bInterfaceNumber != 0) { + intf->cur_altsetting->desc.bInterfaceNumber != GIP_WIRED_INTF_DATA) { /* * The Xbox One controller lists three interfaces all with the * same interface class, subclass and protocol. Differentiate by -- 2.39.2