Re: [PATCH] hid: sony: Drop invalid Sixaxis input reports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 23 Jul 2015, Frank Praznik wrote:

> When connected via Bluetooth the sixaxis periodically sends reports with
> an ID of 1, the second byte 0xff and the rest zeroed.  These reports are
> not related to the controller state and must be dropped to avoid generating
> false input events.
> 
> Signed-off-by: Frank Praznik <frank.praznik@xxxxxxxxx>
> ---
>  drivers/hid/hid-sony.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
> index ed2f008..beb2b02 100644
> --- a/drivers/hid/hid-sony.c
> +++ b/drivers/hid/hid-sony.c
> @@ -1270,6 +1270,17 @@ static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
>  	 * has to be BYTE_SWAPPED before passing up to joystick interface
>  	 */
>  	if ((sc->quirks & SIXAXIS_CONTROLLER) && rd[0] == 0x01 && size == 49) {
> +		/*
> +		 * When connected via Bluetooth the Sixaxis occasionally sends
> +		 * a report with the second byte 0xff and the rest zeroed.
> +		 *
> +		 * This report does not reflect the actual state of the
> +		 * controller must be ignored to avoid generating false input
> +		 * events.
> +		 */
> +		if (rd[1] == 0xff)
> +			return -EINVAL;
> +

Given that this is not a regression and given the current development 
phase, I've applied it to for-4.3/sony.

Thanks,

-- 
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux