summaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet
diff options
context:
space:
mode:
authorMike Auty <ikelos@gentoo.org>2010-08-29 05:35:17 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-08-29 06:39:04 +0200
commitd9f66c1a46163c7c83411058516a69da547262f8 (patch)
tree46b580076157077f0074666db4863815390cc991 /drivers/input/tablet
parentInput: pxa27x_keypad - remove input_free_device() in pxa27x_keypad_remove() (diff)
downloadlinux-d9f66c1a46163c7c83411058516a69da547262f8.tar.xz
linux-d9f66c1a46163c7c83411058516a69da547262f8.zip
Input: wacom - fix mousewheel handling for old wacom tablets
This fixes a regression introduced in 3b57ca0f80c5c8994b5b1e3d3f904cfe727951f2. The data[6] byte contains either 1 or -1 depending on the whether the mouse wheel on older wacom tablets is moved down (1) or up (-1). The patch introduced in the above commit changed the cast from (signed char) to (signed). When cast as a signed integer and negated, the value of -1 (stored in the byte as 0xff) became -255 rather than 1. This patch reverts the cast to a (signed char) and also removes an unnecessary (signed) cast, as all the values operated on are bitmasked. Signed-off-by: Mike Auty <ikelos@gentoo.org> Reviewed-by: Ping Cheng <pingc@wacom.com> Cc; stable@kernel.org Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/wacom_wac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 40d77ba8fdc1..6e29badb969e 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -243,10 +243,10 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
if (features->type == WACOM_G4 ||
features->type == WACOM_MO) {
input_report_abs(input, ABS_DISTANCE, data[6] & 0x3f);
- rw = (signed)(data[7] & 0x04) - (data[7] & 0x03);
+ rw = (data[7] & 0x04) - (data[7] & 0x03);
} else {
input_report_abs(input, ABS_DISTANCE, data[7] & 0x3f);
- rw = -(signed)data[6];
+ rw = -(signed char)data[6];
}
input_report_rel(input, REL_WHEEL, rw);
}