]>
Commit | Line | Data |
---|---|---|
156d8e2c SL |
1 | From 808fc852d5f2b34700da78e0fecbbb44a573e164 Mon Sep 17 00:00:00 2001 |
2 | From: Clement Calmels <clement.calmels@free.fr> | |
3 | Date: Sat, 12 Dec 2015 21:20:11 -0800 | |
4 | Subject: Input: xpad - remove spurious events of wireless xpad 360 controller | |
5 | ||
6 | [ Upstream commit 93a017aa2f77291752e637bfd83f2459dba714cb ] | |
7 | ||
8 | When powering up a wireless xbox 360 controller, some wrong joystick | |
9 | events are generated. It is annoying because, for example, it makes | |
10 | unwanted moves in Steam big picture mode's menu. | |
11 | ||
12 | When my controller is powering up, this packet is received by the | |
13 | driver: | |
14 | 00000000: 00 0f 00 f0 00 cc ff cf 8b e0 86 6a 68 f0 00 20 ...........jh.. | |
15 | 00000010: 13 e3 20 1d 30 03 40 01 50 01 ff ff .. .0.@.P... | |
16 | ||
17 | According to xboxdrv userspace driver source code, this packet is only | |
18 | dumping a serial id and should not be interpreted as joystick events. | |
19 | This issue can be easily seen with jstest: | |
20 | $ jstest --event /dev/input/js0 | |
21 | ||
22 | This patch only adds a way to filter out this "serial" packet and as a | |
23 | result it removes the spurous events. | |
24 | ||
25 | Signed-off-by: Clement Calmels <clement.calmels@free.fr> | |
26 | Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> | |
27 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
28 | --- | |
29 | drivers/input/joystick/xpad.c | 2 +- | |
30 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
31 | ||
32 | diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c | |
33 | index 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 | -- | |
46 | 2.17.1 | |
47 |