Input: xpad - don't depend on endpoint order
authorCameron Gutman <aicommander@gmail.com>
Wed, 4 Jan 2017 06:40:38 +0000 (22:40 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:44:22 +0000 (09:44 +0100)
commit82e3ce0fd874a54dfe15da32bb092bc3558b17d2
tree355b8ff3f926c7e11d97a028bbe432017083c2bb
parent31abdb63b18584aee54a610468dc790e8fa822fb
Input: xpad - don't depend on endpoint order

[ Upstream commit c01b5e7464f0cf20936d7467c7528163c4e2782d ]

The order of endpoints is well defined on official Xbox pads, but
we have found at least one 3rd-party pad that doesn't follow the
standard ("Titanfall 2 Xbox One controller" 0e6f:0165).

Fortunately, we get lucky with this specific pad because it uses
endpoint addresses that differ only by direction. We know that
there are other pads out where this is not true, so let's go
ahead and fix this.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/joystick/xpad.c