Skip to contentSkip to conversation

Input: xpad - add support for generic clone X-Input gamepads

PATCH In review Ishaan Dandekar 1 participant 2 messages Jul 27 – Aug 17

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Input: xpad - add support for generic clone X-Input gamepads

This device exposes a vendor-specific Xbox 360 interface (0283:0001) but was previously ignored by the driver, causing it to fall back to a generic hid interface. Adding its ID to xpad_device and xpad_table allows it to initialize correctly as an X-Input gamepad.

---
Changes in v3:
- Swapped USB_DEVICE() macro for XPAD_XBOX360_VENDOR().
- Fixed comment alignment.

Changes in v2:
- Wrapped commit message at 72 columns.
- Separated from the USB series to target the input subsystem directly.

 drivers/input/joystick/xpad.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -0
index feb8f368f..1e5eb601e 100644
@@ -99,6 +99,7 @@ static const struct xpad_device {
 } xpad_device[] = {
 	/* Please keep this list sorted by vendor and product ID. */
 	{ 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 },
+	{ 0x0283, 0x0001, "Generic X-Input Gamepad", 0, XTYPE_XBOX360 },
 	{ 0x0351, 0x1000, "CRKD LP Blueberry Burst Pro Edition (Xbox)", 0, XTYPE_XBOX360 },
 	{ 0x0351, 0x2000, "CRKD LP Black Tribal Edition (Xbox) ", 0, XTYPE_XBOX360 },
 	{ 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 },
@@ -496,6 +497,7 @@ static const struct usb_device_id xpad_table[] = {
 	 */
 	{ USB_INTERFACE_INFO('X', 'B', 0) },	/* Xbox USB-IF not-approved class */
 	XPAD_XBOX360_VENDOR(0x0079),		/* GPD Win 2 controller */
+	XPAD_XBOX360_VENDOR(0x0283),		/* Generic X-Input Gamepad */
 	XPAD_XBOX360_VENDOR(0x0351),		/* CRKD Controllers */
 	XPAD_XBOX360_VENDOR(0x03eb),		/* Wooting Keyboards (Legacy) */
 	XPAD_XBOX360_VENDOR(0x03f0),		/* HP HyperX Xbox 360 controllers */
Signature · 1 line
2.34.1
#1 lore raw

Hi Dmitry,
Ping - just following up to see if there is any feedback on this patch, or if it looks good to be queued up for the next merge window?
Note: The companion USB quirk patch for this hardware was recently pulled into 7.2 and backported to the stable trees, so this xpad patch is the final piece to get the controller fully functioning.

Thanks,
Ishaan

Quoted 42 lines · Ishaan Dandekar

This device exposes a vendor-specific Xbox 360 interface (0283:0001) but was previously ignored by the driver, causing it to fall back to a generic hid interface. Adding its ID to xpad_device and xpad_table allows it to initialize correctly as an X-Input gamepad.

---
Changes in v3:
- Swapped USB_DEVICE() macro for XPAD_XBOX360_VENDOR().
- Fixed comment alignment.

Changes in v2:
- Wrapped commit message at 72 columns.
- Separated from the USB series to target the input subsystem directly.

 drivers/input/joystick/xpad.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -1
index feb8f368f..1e5eb601e 100644
@@ -99,6 +99,7 @@ static const struct xpad_device {
 } xpad_device[] = {
        /* Please keep this list sorted by vendor and product ID. */
        { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 },
+       { 0x0283, 0x0001, "Generic X-Input Gamepad", 0, XTYPE_XBOX360 },
        { 0x0351, 0x1000, "CRKD LP Blueberry Burst Pro Edition (Xbox)", 0, XTYPE_XBOX360 },
        { 0x0351, 0x2000, "CRKD LP Black Tribal Edition (Xbox) ", 0, XTYPE_XBOX360 },
        { 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 },
@@ -496,6 +497,7 @@ static const struct usb_device_id xpad_table[] = {
         */
        { USB_INTERFACE_INFO('X', 'B', 0) },    /* Xbox USB-IF not-approved class */
        XPAD_XBOX360_VENDOR(0x0079),            /* GPD Win 2 controller */
+       XPAD_XBOX360_VENDOR(0x0283),            /* Generic X-Input Gamepad */
        XPAD_XBOX360_VENDOR(0x0351),            /* CRKD Controllers */
        XPAD_XBOX360_VENDOR(0x03eb),            /* Wooting Keyboards (Legacy) */
        XPAD_XBOX360_VENDOR(0x03f0),            /* HP HyperX Xbox 360 controllers */
--

2.34.1