diff options
author | Stefan Kriwanek <dev@stefankriwanek.de> | 2013-08-25 10:46:13 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 17:15:34 -0700 |
commit | 355c557b3e0164eaf75aded30e92da5a3a818c5f (patch) | |
tree | 562b3d01217c4d9860231dcc5d273e85f880935d /drivers | |
parent | f09344e3369f147b5c2c91e57ef2e91e2b7e8320 (diff) | |
download | lwn-355c557b3e0164eaf75aded30e92da5a3a818c5f.tar.gz lwn-355c557b3e0164eaf75aded30e92da5a3a818c5f.zip |
HID: Fix Speedlink VAD Cezanne support for some devices
commit 06bb5219118fb098f4b0c7dcb484b28a52bf1c14 upstream.
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: Stefan Kriwanek <mail@stefankriwanek.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/hid-speedlink.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hid/hid-speedlink.c b/drivers/hid/hid-speedlink.c index 602013741718..2b03c9baac35 100644 --- a/drivers/hid/hid-speedlink.c +++ b/drivers/hid/hid-speedlink.c @@ -3,7 +3,7 @@ * Fixes "jumpy" cursor and removes nonexistent keyboard LEDS from * the HID descriptor. * - * Copyright (c) 2011 Stefan Kriwanek <mail@stefankriwanek.de> + * Copyright (c) 2011, 2013 Stefan Kriwanek <dev@stefankriwanek.de> */ /* @@ -48,8 +48,13 @@ static int speedlink_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) { /* 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; /* Drop useless distance 0 events (on button clicks etc.) as well */ if (value == 0) |