Input: xpad - fix GPD Win 2 controller name
authorEnno Boland <gottox@voidlinux.eu>
Tue, 19 Jun 2018 18:55:33 +0000 (11:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:27:09 +0000 (11:27 +0200)
commit9be75ae5a70f24905a17cfc345f3ee310f7ce415
tree31b8abae6933a8678c758816f2153ad45da55d40
parent238e2637c64123aadb7ab6c1095ad23593b65e3f
Input: xpad - fix GPD Win 2 controller name

commit dd6bee81c942c0ea01030da9356026afb88f9d18 upstream.

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: c1ba08390a8b ("Input: xpad - add GPD Win 2 Controller USB IDs")
Cc: stable@vger.kernel.org
Signed-off-by: Enno Boland <gottox@voidlinux.eu>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/joystick/xpad.c