diff options
author | Ping Cheng <pingc@wacom.com> | 2005-08-16 18:16:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-17 00:06:25 -0400 |
commit | dc1d97e466c2836adebe5618759bfb5b35b3bc0a (patch) | |
tree | 89d4d85e4b4ab2652662bc5f9b65af8f08874ee0 /drivers | |
parent | 33a5c72432ef3e75dcf546bf41bcbfce697903ff (diff) |
[PATCH] USB: fix usb wacom tablet driver bug
This patch fixes bug 4905 and a Cintiq 21UX bug.
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/input/wacom.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index 02412e31a46b..3b266af3048a 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c | |||
@@ -342,9 +342,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
342 | goto exit; | 342 | goto exit; |
343 | } | 343 | } |
344 | 344 | ||
345 | x = le16_to_cpu(*(__le16 *) &data[2]); | ||
346 | y = le16_to_cpu(*(__le16 *) &data[4]); | ||
347 | |||
348 | input_regs(dev, regs); | 345 | input_regs(dev, regs); |
349 | 346 | ||
350 | if (data[1] & 0x10) { /* in prox */ | 347 | if (data[1] & 0x10) { /* in prox */ |
@@ -373,15 +370,17 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
373 | } | 370 | } |
374 | } | 371 | } |
375 | 372 | ||
376 | if (data[1] & 0x80) { | 373 | if (data[1] & 0x90) { |
374 | x = le16_to_cpu(*(__le16 *) &data[2]); | ||
375 | y = le16_to_cpu(*(__le16 *) &data[4]); | ||
377 | input_report_abs(dev, ABS_X, x); | 376 | input_report_abs(dev, ABS_X, x); |
378 | input_report_abs(dev, ABS_Y, y); | 377 | input_report_abs(dev, ABS_Y, y); |
379 | } | 378 | if (wacom->tool[0] != BTN_TOOL_MOUSE) { |
380 | if (wacom->tool[0] != BTN_TOOL_MOUSE) { | 379 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); |
381 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); | 380 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); |
382 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); | 381 | input_report_key(dev, BTN_STYLUS, data[1] & 0x02); |
383 | input_report_key(dev, BTN_STYLUS, data[1] & 0x02); | 382 | input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); |
384 | input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); | 383 | } |
385 | } | 384 | } |
386 | 385 | ||
387 | input_report_key(dev, wacom->tool[0], data[1] & 0x10); | 386 | input_report_key(dev, wacom->tool[0], data[1] & 0x10); |
@@ -568,7 +567,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
568 | 567 | ||
569 | /* Cintiq doesn't send data when RDY bit isn't set */ | 568 | /* Cintiq doesn't send data when RDY bit isn't set */ |
570 | if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) | 569 | if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) |
571 | return; | 570 | goto exit; |
572 | 571 | ||
573 | if (wacom->features->type >= INTUOS3) { | 572 | if (wacom->features->type >= INTUOS3) { |
574 | input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); | 573 | input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); |