All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Input: xpad - remove spurious events of wireless xpad 360 controller
@ 2015-11-22 16:35 clement.calmels
  2015-12-09 17:32 ` Clement Calmels
  2015-12-13  5:21 ` Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: clement.calmels @ 2015-11-22 16:35 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input, linux-kernel; +Cc: Clement Calmels

From: Clement Calmels <clement.calmels@free.fr>

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>
---
 drivers/input/joystick/xpad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index fd4100d..c44cbd4 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -527,7 +527,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]);
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Input: xpad - remove spurious events of wireless xpad 360 controller
  2015-11-22 16:35 [PATCH v2] Input: xpad - remove spurious events of wireless xpad 360 controller clement.calmels
@ 2015-12-09 17:32 ` Clement Calmels
  2015-12-13  5:21 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Clement Calmels @ 2015-12-09 17:32 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input, linux-kernel, Greg Kroah-Hartman

On Sun, 22 Nov 2015 17:35:39 +0100
clement.calmels@free.fr wrote:

> From: Clement Calmels <clement.calmels@free.fr>
> 
> 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>
> ---
>  drivers/input/joystick/xpad.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/joystick/xpad.c
> b/drivers/input/joystick/xpad.c index fd4100d..c44cbd4 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -527,7 +527,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]);

Hi,

This patch is waiting for a review since 30 days:
http://marc.info/?l=linux-input&m=144821014611458&w=2
Please have a look.

Best regards,
Clement

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Input: xpad - remove spurious events of wireless xpad 360 controller
  2015-11-22 16:35 [PATCH v2] Input: xpad - remove spurious events of wireless xpad 360 controller clement.calmels
  2015-12-09 17:32 ` Clement Calmels
@ 2015-12-13  5:21 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2015-12-13  5:21 UTC (permalink / raw)
  To: clement.calmels; +Cc: linux-input, linux-kernel

On Sun, Nov 22, 2015 at 05:35:39PM +0100, clement.calmels@free.fr wrote:
> From: Clement Calmels <clement.calmels@free.fr>
> 
> 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>

Applied, thank you.

> ---
>  drivers/input/joystick/xpad.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index fd4100d..c44cbd4 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -527,7 +527,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]);
> -- 
> 2.6.2
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-13  5:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-22 16:35 [PATCH v2] Input: xpad - remove spurious events of wireless xpad 360 controller clement.calmels
2015-12-09 17:32 ` Clement Calmels
2015-12-13  5:21 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.