]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.166/input-xpad-remove-spurious-events-of-wireless-xpad-3.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 4.4.166 / input-xpad-remove-spurious-events-of-wireless-xpad-3.patch
CommitLineData
156d8e2c
SL
1From 808fc852d5f2b34700da78e0fecbbb44a573e164 Mon Sep 17 00:00:00 2001
2From: Clement Calmels <clement.calmels@free.fr>
3Date: Sat, 12 Dec 2015 21:20:11 -0800
4Subject: Input: xpad - remove spurious events of wireless xpad 360 controller
5
6[ Upstream commit 93a017aa2f77291752e637bfd83f2459dba714cb ]
7
8When powering up a wireless xbox 360 controller, some wrong joystick
9events are generated. It is annoying because, for example, it makes
10unwanted moves in Steam big picture mode's menu.
11
12When my controller is powering up, this packet is received by the
13driver:
1400000000: 00 0f 00 f0 00 cc ff cf 8b e0 86 6a 68 f0 00 20 ...........jh..
1500000010: 13 e3 20 1d 30 03 40 01 50 01 ff ff .. .0.@.P...
16
17According to xboxdrv userspace driver source code, this packet is only
18dumping a serial id and should not be interpreted as joystick events.
19This issue can be easily seen with jstest:
20$ jstest --event /dev/input/js0
21
22This patch only adds a way to filter out this "serial" packet and as a
23result it removes the spurous events.
24
25Signed-off-by: Clement Calmels <clement.calmels@free.fr>
26Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
27Signed-off-by: Sasha Levin <sashal@kernel.org>
28---
29 drivers/input/joystick/xpad.c | 2 +-
30 1 file changed, 1 insertion(+), 1 deletion(-)
31
32diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
33index 3258baf3282e..2f16d07db8ef 100644
34--- a/drivers/input/joystick/xpad.c
35+++ b/drivers/input/joystick/xpad.c
36@@ -546,7 +546,7 @@ static void xpad360w_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned cha
37 }
38
39 /* Valid pad data */
40- if (!(data[1] & 0x1))
41+ if (data[1] != 0x1)
42 return;
43
44 xpad360_process_packet(xpad, cmd, &data[4]);
45--
462.17.1
47