All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Vicki Pfau <vi@endrift.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Sasha Levin <sashal@kernel.org>,
	rojtberg@gmail.com, nate@yocom.org, mkorpershoek@baylibre.com,
	pgriffais@valvesoftware.com, aicommander@gmail.com,
	chaorace@gmail.com, s.demassari@gmail.com,
	linux-input@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 13/13] Input: xpad - add constants for GIP interface numbers
Date: Tue,  9 May 2023 17:20:21 -0400	[thread overview]
Message-ID: <20230509212023.22105-13-sashal@kernel.org> (raw)
In-Reply-To: <20230509212023.22105-1-sashal@kernel.org>

From: Vicki Pfau <vi@endrift.com>

[ 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 <vi@endrift.com>
Link: https://lore.kernel.org/r/20230411031650.960322-2-vi@endrift.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 dbfabd229a7c6..a7af9b56e338f 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -493,6 +493,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).
@@ -1821,7 +1824,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


      parent reply	other threads:[~2023-05-09 21:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 21:20 [PATCH AUTOSEL 5.15 01/13] RDMA/core: Fix multiple -Warray-bounds warnings Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 02/13] iommu/arm-smmu-qcom: Limit the SMR groups to 128 Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 03/13] fs/ntfs3: Fix NULL pointer dereference in 'ni_write_inode' Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 04/13] fs/ntfs3: Enhance the attribute size check Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 05/13] fs/ntfs3: Fix NULL dereference in ni_write_inode Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 06/13] fs/ntfs3: Validate MFT flags before replaying logs Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 07/13] fs/ntfs3: Add length check in indx_get_root Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 08/13] fs/ntfs3: Fix a possible null-pointer dereference in ni_clear() Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 09/13] clk: tegra20: fix gcc-7 constant overflow warning Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 10/13] iommu/arm-smmu-v3: Acknowledge pri/event queue overflow if any Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 11/13] iommu/sprd: Release dma buffer to avoid memory leak Sasha Levin
2023-05-09 21:20 ` [PATCH AUTOSEL 5.15 12/13] power: supply: axp288_charger: Use alt usb-id extcon on some x86 android tablets Sasha Levin
2023-05-09 21:20 ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230509212023.22105-13-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=aicommander@gmail.com \
    --cc=chaorace@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkorpershoek@baylibre.com \
    --cc=nate@yocom.org \
    --cc=pgriffais@valvesoftware.com \
    --cc=rojtberg@gmail.com \
    --cc=s.demassari@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=vi@endrift.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.