Skip to content

Commit

Permalink
Input: xpad - fix GPD Win 2 controller name
Browse files Browse the repository at this point in the history
This fixes using the controller with SDL2.

SDL2 has a naive algorithm to apply the correct settings to a controller.
For X-Box compatible controllers it expects that the controller name
contains a variation of a 'XBOX'-string.

This patch changes the identifier to contain "X-Box" as substring.  Tested
with Steam and C-Dogs-SDL which both detect the controller properly after
adding this patch.

Fixes: c1ba083 ("Input: xpad - add GPD Win 2 Controller USB IDs")
Cc: [email protected]
Signed-off-by: Enno Boland <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
Enno Boland authored and dtor committed Jun 22, 2018
1 parent 50fc7b6 commit dd6bee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/joystick/xpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static const struct xpad_device {
u8 mapping;
u8 xtype;
} xpad_device[] = {
{ 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 },
{ 0x0079, 0x18d4, "GPD Win 2 X-Box 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 },
Expand Down

0 comments on commit dd6bee8

Please sign in to comment.