aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kriwanek <dev@stefankriwanek.de>2013-08-25 04:46:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 20:18:16 -0400
commit469e7f80f25f79a4c11bed47027da81fcf30d045 (patch)
tree73bfdbac3e6b72130c30d319bcf332c3d3c41323
parent769eea247c41519e72675c72d0da8d95fd6b7c09 (diff)
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>
-rw-r--r--drivers/hid/hid-speedlink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hid/hid-speedlink.c b/drivers/hid/hid-speedlink.c
index a2f587d004e1..7112f3e832ee 100644
--- a/drivers/hid/hid-speedlink.c
+++ b/drivers/hid/hid-speedlink.c
@@ -3,7 +3,7 @@
3 * Fixes "jumpy" cursor and removes nonexistent keyboard LEDS from 3 * Fixes "jumpy" cursor and removes nonexistent keyboard LEDS from
4 * the HID descriptor. 4 * the HID descriptor.
5 * 5 *
6 * Copyright (c) 2011 Stefan Kriwanek <mail@stefankriwanek.de> 6 * Copyright (c) 2011, 2013 Stefan Kriwanek <dev@stefankriwanek.de>
7 */ 7 */
8 8
9/* 9/*
@@ -46,8 +46,13 @@ static int speedlink_event(struct hid_device *hdev, struct hid_field *field,
46 struct hid_usage *usage, __s32 value) 46 struct hid_usage *usage, __s32 value)
47{ 47{
48 /* No other conditions due to usage_table. */ 48 /* No other conditions due to usage_table. */
49 /* Fix "jumpy" cursor (invalid events sent by device). */ 49
50 if (value == 256) 50 /* This fixes the "jumpy" cursor occuring due to invalid events sent
51 * by the device. Some devices only send them with value==+256, others
52 * don't. However, catching abs(value)>=256 is restrictive enough not
53 * to interfere with devices that were bug-free (has been tested).
54 */
55 if (abs(value) >= 256)
51 return 1; 56 return 1;
52 /* Drop useless distance 0 events (on button clicks etc.) as well */ 57 /* Drop useless distance 0 events (on button clicks etc.) as well */
53 if (value == 0) 58 if (value == 0)