Code:
diff -uNr vanilla/src/2.6.19/wacom.h mine/src/2.6.19/wacom.h
--- vanilla/src/2.6.19/wacom.h 2008-04-11 18:11:30.000000000 -0400
+++ mine/src/2.6.19/wacom.h 2008-04-18 07:21:55.000000000 -0400
@@ -125,6 +125,7 @@
extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_tpc(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
extern __u16 wacom_le16_to_cpu(unsigned char *data);
extern __u16 wacom_be16_to_cpu(unsigned char *data);
extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id);
diff -uNr vanilla/src/2.6.19/wacom_wac.c mine/src/2.6.19/wacom_wac.c
--- vanilla/src/2.6.19/wacom_wac.c 2008-04-11 18:11:30.000000000 -0400
+++ mine/src/2.6.19/wacom_wac.c 2008-04-18 11:10:48.000000000 -0400
@@ -535,6 +535,92 @@
return 1;
}
+int wacom_tpc_irq (struct wacom_wac *wacom_wac, void *wcombo)
+{
+ static int stylus_inrange;
+ char *data = wacom_wac->data;
+ struct wacom_combo *combo = wcombo;
+ struct urb *urb = combo->urb;
+ if (urb->actual_length == 5) { /* Finger */
+ int absx = ((data[2] << 8) & 0xff00) + (data[1] & 0xff);
+ int absy = ((data[4] << 8) & 0xff00) + (data[3] & 0xff);
+
+ if (stylus_inrange) {
+ if (wacom_wac->tool[1]) {
+ return 0;
+ } else {
+ wacom_report_key (wcombo, BTN_TOOL_PEN, 0);
+ wacom_report_key (wcombo, BTN_TOUCH, 0);
+ wacom_report_abs (wcombo, ABS_PRESSURE, 0);
+ wacom_wac->tool[1] = 1;
+ goto end;
+ }
+ }
+ wacom_wac->tool[1] = 0;
+
+ absx = (absx * wacom_wac->features->x_max) / 4096;
+ absy = (absy * wacom_wac->features->y_max) / 4096;
+ wacom_report_key (wcombo, ABS_MISC, STYLUS_DEVICE_ID);
+ wacom_report_key (wcombo, BTN_TOOL_PEN, data[0] & 0x1);
+ wacom_report_key (wcombo, BTN_TOUCH, data[0] & 0x1);
+ wacom_report_abs (wcombo, ABS_X, absx);
+ wacom_report_abs (wcombo, ABS_Y, absy);
+ if (data[0] & 0x1)
+ wacom_report_abs (wcombo, ABS_PRESSURE, 255);
+ else
+ wacom_report_abs (wcombo, ABS_PRESSURE, 0);
+ } else { /* Stylus */
+ int absx = ((data[3] << 8) & 0xff00) + (data[2] & 0xff);
+ int absy = ((data[5] << 8) & 0xff00) + (data[4] & 0xff);
+ int absp = ((data[7] << 8) & 0x0100) + (data[6] & 0xff);
+ int oldtool = wacom_wac->tool[0];
+ stylus_inrange = data[1] & 0x20;
+
+ if (data[1] == 0) { /* Out of range */
+ wacom_wac->tool[0] = 0;
+ wacom_report_key (wcombo, BTN_TOOL_RUBBER, 0);
+ wacom_report_key (wcombo, BTN_TOOL_PEN, 0);
+ wacom_report_key (wcombo, BTN_TOUCH, 0);
+ wacom_report_key (wcombo, BTN_STYLUS, 0);
+ wacom_report_key (wcombo, BTN_STYLUS2, 0);
+ goto end;
+ } else if (data[1] & 0x8) { /* Eraser */
+ wacom_wac->tool[0] = BTN_TOOL_RUBBER;
+
+ if (oldtool == BTN_TOOL_PEN) {
+ wacom_report_key (wcombo, BTN_TOOL_PEN, 0);
+ wacom_report_key (wcombo, BTN_TOUCH, 0);
+ wacom_report_key (wcombo, BTN_STYLUS, 0);
+ wacom_report_key (wcombo, BTN_STYLUS2, 0);
+ goto end;
+ }
+ wacom_report_key (wcombo, BTN_TOOL_RUBBER, data[1] & 0x20);
+ wacom_report_key (wcombo, BTN_TOUCH, (data[1] & 0x4));
+ wacom_report_abs (wcombo, ABS_MISC, STYLUS_DEVICE_ID);
+ } else { /* Pen */
+ wacom_wac->tool[0] = BTN_TOOL_PEN;
+
+ if (oldtool == BTN_TOOL_RUBBER) {
+ wacom_report_key (wcombo, BTN_TOOL_RUBBER, 0);
+ wacom_report_key (wcombo, BTN_TOUCH, 0);
+ goto end;
+ }
+ wacom_report_key (wcombo, BTN_TOOL_PEN, data[1] & 0x20);
+ wacom_report_key (wcombo, BTN_TOUCH, (data[1] & 0x1));
+ wacom_report_abs (wcombo, ABS_MISC, STYLUS_DEVICE_ID);
+ }
+
+ wacom_report_key (wcombo, BTN_STYLUS, data[1] & 0x2);
+ wacom_report_key (wcombo, BTN_STYLUS2, data[1] & 0x10);
+ wacom_report_abs (wcombo, ABS_X, absx);
+ wacom_report_abs (wcombo, ABS_Y, absy);
+ wacom_report_abs (wcombo, ABS_PRESSURE, absp);
+ }
+end:
+ wacom_input_sync(wcombo);
+ return 0;
+}
+
int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
{
switch (wacom_wac->features->type) {
@@ -560,6 +646,9 @@
case WACOM_BEE:
return (wacom_intuos_irq(wacom_wac, wcombo));
break;
+ case TABLETPC:
+ return (wacom_tpc_irq(wacom_wac, wcombo));
+ break;
default:
return 0;
}
@@ -596,6 +685,9 @@
case PENPARTNER:
input_dev_pt(input_dev, wacom_wac);
break;
+ case TABLETPC:
+ input_dev_tpc(input_dev, wacom_wac);
+ break;
}
return;
}
@@ -651,6 +743,8 @@
{ "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE },
{ "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE },
{ "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
+ { "Wacom ISDv4 USB", 8, 26202, 16325, 255, 0, TABLETPC },
+ { "Wacom ISDv4 USB", 8, 26202, 16325, 255, 0, TABLETPC },
{ }
};
@@ -705,6 +799,8 @@
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x90) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x93) },
{ }
};
diff -uNr vanilla/src/2.6.22/wacom_wac.h mine/src/2.6.22/wacom_wac.h
--- vanilla/src/2.6.22/wacom_wac.h 2008-04-11 18:11:30.000000000 -0400
+++ mine/src/2.6.22/wacom_wac.h 2008-04-18 07:21:55.000000000 -0400
@@ -27,6 +27,7 @@
CINTIQ,
WACOM_BEE,
WACOM_MO,
+ TABLETPC,
MAX_TYPE
};
diff -uNr vanilla/src/2.6.24/wacom_sys.c mine/src/2.6.24/wacom_sys.c
--- vanilla/src/2.6.24/wacom_sys.c 2008-04-11 18:11:30.000000000 -0400
+++ mine/src/2.6.24/wacom_sys.c 2008-04-18 07:21:55.000000000 -0400
@@ -219,6 +219,12 @@
input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER);
}
+void
+input_dev_tpc (struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER);
+}
+
static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct usb_device *dev = interface_to_usbdev(intf);
@@ -286,12 +292,17 @@
goto fail3;
/* Ask the tablet to report tablet data. Repeat until it succeeds */
- do {
- rep_data[0] = rep_data[1] = 2;
- if(usb_set_report(intf, 3, 2, rep_data, 2) >= 0)
- error = usb_get_report(intf, 3, 2, rep_data, 2);
- } while ((error <= 0 || rep_data[1] != 2) && limit++ < 5);
-
+ if (wacom_wac->features->type == TABLETPC) { /* USB ISDv4 (TabletPC) doesn't support SetReport */
+ usb_get_report(intf, 3, 2, rep_data, 2);
+ if (rep_data[0] != 2 || rep_data[1] != 0)
+ info("Got bad report from TabletPC, may not work properly");
+ } else {
+ do {
+ rep_data[0] = rep_data[1] = 2;
+ if(usb_set_report(intf, 3, 2, rep_data, 2) >= 0)
+ error = usb_get_report(intf, 3, 2, rep_data, 2);
+ } while ((error <= 0 || rep_data[1] != 2) && limit++ < 5);
+ }
usb_set_intfdata(intf, wacom);
return 0;
I can't verify that this will work (copying the above patch code into a file from the browser window but try this only as a last resort, I have a web server that I can host files on if need be.
Bookmarks