Commit dc1d97e4 authored by Ping Cheng's avatar Ping Cheng Committed by Linus Torvalds

[PATCH] USB: fix usb wacom tablet driver bug

This patch fixes bug 4905 and a Cintiq 21UX bug.
Signed-off-by: default avatarPing Cheng <pingc@wacom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 33a5c724
...@@ -342,9 +342,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) ...@@ -342,9 +342,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
goto exit; goto exit;
} }
x = le16_to_cpu(*(__le16 *) &data[2]);
y = le16_to_cpu(*(__le16 *) &data[4]);
input_regs(dev, regs); input_regs(dev, regs);
if (data[1] & 0x10) { /* in prox */ if (data[1] & 0x10) { /* in prox */
...@@ -373,16 +370,18 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) ...@@ -373,16 +370,18 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs)
} }
} }
if (data[1] & 0x80) { if (data[1] & 0x90) {
x = le16_to_cpu(*(__le16 *) &data[2]);
y = le16_to_cpu(*(__le16 *) &data[4]);
input_report_abs(dev, ABS_X, x); input_report_abs(dev, ABS_X, x);
input_report_abs(dev, ABS_Y, y); input_report_abs(dev, ABS_Y, y);
}
if (wacom->tool[0] != BTN_TOOL_MOUSE) { if (wacom->tool[0] != BTN_TOOL_MOUSE) {
input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6]));
input_report_key(dev, BTN_TOUCH, data[1] & 0x01); input_report_key(dev, BTN_TOUCH, data[1] & 0x01);
input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS, data[1] & 0x02);
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
} }
}
input_report_key(dev, wacom->tool[0], data[1] & 0x10); input_report_key(dev, wacom->tool[0], data[1] & 0x10);
input_sync(dev); input_sync(dev);
...@@ -568,7 +567,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) ...@@ -568,7 +567,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
/* Cintiq doesn't send data when RDY bit isn't set */ /* Cintiq doesn't send data when RDY bit isn't set */
if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40))
return; goto exit;
if (wacom->features->type >= INTUOS3) { if (wacom->features->type >= INTUOS3) {
input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment