summaryrefslogtreecommitdiff
path: root/drivers/input/joystick/xpad.c
diff options
context:
space:
mode:
authorClement Calmels <clement.calmels@free.fr>2015-12-12 21:20:11 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-01 09:46:36 +0100
commitbec36000f898ade8261711cef6ceb7caf34ceae3 (patch)
tree15d7b42c5835a68df4646f46c2a6bf20355d6135 /drivers/input/joystick/xpad.c
parent2ca8b2a88e7f222a5f2db30778eb99c113fc697a (diff)
Input: xpad - remove spurious events of wireless xpad 360 controller
[ Upstream commit 93a017aa2f77291752e637bfd83f2459dba714cb ] When powering up a wireless xbox 360 controller, some wrong joystick events are generated. It is annoying because, for example, it makes unwanted moves in Steam big picture mode's menu. When my controller is powering up, this packet is received by the driver: 00000000: 00 0f 00 f0 00 cc ff cf 8b e0 86 6a 68 f0 00 20 ...........jh.. 00000010: 13 e3 20 1d 30 03 40 01 50 01 ff ff .. .0.@.P... According to xboxdrv userspace driver source code, this packet is only dumping a serial id and should not be interpreted as joystick events. This issue can be easily seen with jstest: $ jstest --event /dev/input/js0 This patch only adds a way to filter out this "serial" packet and as a result it removes the spurous events. Signed-off-by: Clement Calmels <clement.calmels@free.fr> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/input/joystick/xpad.c')
-rw-r--r--drivers/input/joystick/xpad.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 3258baf3282e..2f16d07db8ef 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -546,7 +546,7 @@ static void xpad360w_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned cha
}
/* Valid pad data */
- if (!(data[1] & 0x1))
+ if (data[1] != 0x1)
return;
xpad360_process_packet(xpad, cmd, &data[4]);