Skip to content

Commit f9b2e60

Browse files
endriftdtor
authored andcommitted
Input: xpad - add constants for GIP interface numbers
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent d6e6808 commit f9b2e60

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/input/joystick/xpad.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,9 @@ struct xboxone_init_packet {
561561
#define GIP_MOTOR_LT BIT(3)
562562
#define GIP_MOTOR_ALL (GIP_MOTOR_R | GIP_MOTOR_L | GIP_MOTOR_RT | GIP_MOTOR_LT)
563563

564+
#define GIP_WIRED_INTF_DATA 0
565+
#define GIP_WIRED_INTF_AUDIO 1
566+
564567
/*
565568
* This packet is required for all Xbox One pads with 2015
566569
* or later firmware installed (or present from the factory).
@@ -2004,7 +2007,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
20042007
}
20052008

20062009
if (xpad->xtype == XTYPE_XBOXONE &&
2007-
intf->cur_altsetting->desc.bInterfaceNumber != 0) {
2010+
intf->cur_altsetting->desc.bInterfaceNumber != GIP_WIRED_INTF_DATA) {
20082011
/*
20092012
* The Xbox One controller lists three interfaces all with the
20102013
* same interface class, subclass and protocol. Differentiate by

0 commit comments

Comments
 (0)