Skip to contentSkip to conversation

xpad: Add GPD Win 2 Controller USB IDs

PATCH In review [email protected] 2 participants 3 messages May 31, 2018

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

PATCH v4 1/1 xpad: Add GPD Win 2 Controller USB IDs

From: Ethan Lee <[email protected]>

GPD Win 2 Website: http://www.gpd.hk/gpdwin2.asp

Tested on a unit from the first production run sent to Indiegogo backers

---
 drivers/input/joystick/xpad.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -0
index 06e9650b3b30..a89b81b35932 100644
@@ -123,6 +123,7 @@ static const struct xpad_device {
 	u8 mapping;
 	u8 xtype;
 } xpad_device[] = {
+	{ 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 },
 	{ 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
 	{ 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
 	{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
@@ -409,6 +410,7 @@ static const signed short xpad_abs_triggers[] = {
 
 static const struct usb_device_id xpad_table[] = {
 	{ USB_INTERFACE_INFO('X', 'B', 0) },	/* X-Box USB-IF not approved class */
+	XPAD_XBOX360_VENDOR(0x0079),		/* GPD Win 2 Controller */
 	XPAD_XBOX360_VENDOR(0x044f),		/* Thrustmaster X-Box 360 controllers */
 	XPAD_XBOX360_VENDOR(0x045e),		/* Microsoft X-Box 360 controllers */
 	XPAD_XBOXONE_VENDOR(0x045e),		/* Microsoft X-Box One controllers */
Signature · 1 line
2.13.6
author
#1 lore raw

Aaand right as I send these I see git-send-email auto-CC'd stable directly again. Sorry!

-Ethan

Quoted 32 lines · On 05/31/2018 08:10 AM, [email protected] wrote:

From: Ethan Lee <[email protected]>

GPD Win 2 Website: http://www.gpd.hk/gpdwin2.asp

Tested on a unit from the first production run sent to Indiegogo backers

---
  drivers/input/joystick/xpad.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -0
index 06e9650b3b30..a89b81b35932 100644
@@ -123,6 +123,7 @@ static const struct xpad_device {
  	u8 mapping;
  	u8 xtype;
  } xpad_device[] = {
+	{ 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 },
  	{ 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
  	{ 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
  	{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
@@ -409,6 +410,7 @@ static const signed short xpad_abs_triggers[] = {
 
  static const struct usb_device_id xpad_table[] = {
  	{ USB_INTERFACE_INFO('X', 'B', 0) },	/* X-Box USB-IF not approved class */
+	XPAD_XBOX360_VENDOR(0x0079),		/* GPD Win 2 Controller */
  	XPAD_XBOX360_VENDOR(0x044f),		/* Thrustmaster X-Box 360 controllers */
  	XPAD_XBOX360_VENDOR(0x045e),		/* Microsoft X-Box 360 controllers */
  	XPAD_XBOXONE_VENDOR(0x045e),		/* Microsoft X-Box One controllers */
maintainer
#2 lore raw

Hi Ethan,

- stable@ to BCC

Quoted 13 lines · Ethan Lee

Aaand right as I send these I see git-send-email auto-CC'd stable directly again. Sorry!

-Ethan

Quoted 6 lines · On 05/31/2018 08:10 AM, [email protected] wrote:

From: Ethan Lee <[email protected]>

GPD Win 2 Website: http://www.gpd.hk/gpdwin2.asp

Tested on a unit from the first production run sent to Indiegogo backers

So I understand that adding this new VID/PID pair to the xpad driver makes controller recognize the device,
but the button/axis mapping is not what it should be. Does it mean that the mapping is different from other xpad controllers, or the mapping that we are using is messed up for all/most of them?

It looks like the mapping we use is quite a mess, I wonder if we could not bite the bullet and unify it so it follows Documentation/input/gamepad.rst... I would make users update their existing configs, but the new installations would be more sensible. Just a thought... Or you could tell me that nobody pays attention to what kernel sends and everyone remaps anyway...

Quoted 32 lines
Quoted 31 lines
---
  drivers/input/joystick/xpad.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +1 -0
index 06e9650b3b30..a89b81b35932 100644
@@ -123,6 +123,7 @@ static const struct xpad_device {
        u8 mapping;
        u8 xtype;
  } xpad_device[] = {
+       { 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 },
        { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
        { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
        { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX

},

drivers/input/joystick/xpad.c +0 -0
@@ -409,6 +410,7 @@ static const signed short xpad_abs_triggers[] = {
    static const struct usb_device_id xpad_table[] = {
        { USB_INTERFACE_INFO('X', 'B', 0) },    /* X-Box USB-IF not

approved class */
+ XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 Controller */

        XPAD_XBOX360_VENDOR(0x044f),            /* Thrustmaster X-Box 360
controllers */
        XPAD_XBOX360_VENDOR(0x045e),            /* Microsoft X-Box 360
controllers */
        XPAD_XBOXONE_VENDOR(0x045e),            /* Microsoft X-Box One

controllers */

Signature · 1 line
Dmitry