Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06bb5219 authored by Stefan Kriwanek's avatar Stefan Kriwanek Committed by Jiri Kosina
Browse files

HID: Fix Speedlink VAD Cezanne support for some devices



Some devices of the "Speedlink VAD Cezanne" model need more aggressive fixing
than already done.

I made sure through testing that this patch would not interfere with the proper
working of a device that is bug-free. (The driver drops EV_REL events with
abs(val) >= 256, which are not achievable even on the highest laser resolution
hardware setting.)

Signed-off-by: default avatarStefan Kriwanek <mail@stefankriwanek.de>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 15261f6d
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@
 *  Fixes "jumpy" cursor and removes nonexistent keyboard LEDS from
 *  Fixes "jumpy" cursor and removes nonexistent keyboard LEDS from
 *  the HID descriptor.
 *  the HID descriptor.
 *
 *
 *  Copyright (c) 2011 Stefan Kriwanek <mail@stefankriwanek.de>
 *  Copyright (c) 2011, 2013 Stefan Kriwanek <dev@stefankriwanek.de>
 */
 */


/*
/*
@@ -46,8 +46,13 @@ static int speedlink_event(struct hid_device *hdev, struct hid_field *field,
		struct hid_usage *usage, __s32 value)
		struct hid_usage *usage, __s32 value)
{
{
	/* No other conditions due to usage_table. */
	/* No other conditions due to usage_table. */
	/* Fix "jumpy" cursor (invalid events sent by device). */

	if (value == 256)
	/* This fixes the "jumpy" cursor occuring due to invalid events sent
	 * by the device. Some devices only send them with value==+256, others
	 * don't. However, catching abs(value)>=256 is restrictive enough not
	 * to interfere with devices that were bug-free (has been tested).
	 */
	if (abs(value) >= 256)
		return 1;
		return 1;
	/* Drop useless distance 0 events (on button clicks etc.) as well */
	/* Drop useless distance 0 events (on button clicks etc.) as well */
	if (value == 0)
	if (value == 0)