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 DAE48C77B7C for ; Tue, 9 May 2023 21:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236069AbjEIVYS (ORCPT ); Tue, 9 May 2023 17:24:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236065AbjEIVXz (ORCPT ); Tue, 9 May 2023 17:23:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E59116A4B; Tue, 9 May 2023 14:21:25 -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 A131763751; Tue, 9 May 2023 21:21:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2694C433EF; Tue, 9 May 2023 21:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683667284; bh=3n+SNcNMcP7hfTQJNvXdLvIKxdODuYOCP6fDOZ6oYRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wh5GiaHviEVzgKuAkD+iQLftXWVsHl5gLt80IkekrS5LpXRNYe2w2/7n77iplbe1X ZsRYY5CDzLlQn5EtjmX0HUfLYEixw23hPCMlIv5/VOZB+o/GIoV47vgpPl9C7/QS5a FL1A49NfqyuOk3VP6OgC7fxNN5E3jV2VSkx1L2SWyOdY/GmPfD2pW9AE+PUDQ0EP6E PWgKnuAyUu0xLJpxltlQEeoHAM8Vp0RRAI+g6VEjc4FWPoOHMtNAfnY0LtfOvVvQW/ j8hyPSSD5ik6E5k8mfBQEpD6C+//acSXTFXQELuW7SwY90jvd3A9Bsjg+OsZxn8ht4 l7eBAcSlrICCA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vicki Pfau , Dmitry Torokhov , Sasha Levin , rojtberg@gmail.com, nate@yocom.org, mkorpershoek@baylibre.com, radon86dev@gmail.com, s.demassari@gmail.com, chaorace@gmail.com, linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 2/2] Input: xpad - add constants for GIP interface numbers Date: Tue, 9 May 2023 17:21:15 -0400 Message-Id: <20230509212115.22774-2-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230509212115.22774-1-sashal@kernel.org> References: <20230509212115.22774-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-input@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 1a12f95227301..f1c2bc108fd76 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -506,6 +506,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). @@ -1830,7 +1833,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