Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 60853 Details for
Bug 95478
linuxwacom-0.7.0 (with Volito2 support)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Kernel patch against linux-2.6.11-gentoo-r9
linuxwacom-0.6.8-volito2_2.6.11-gentoo-r9.patch (text/plain), 27.62 KB, created by
crusaderky
on 2005-06-08 11:07:00 UTC
(
hide
)
Description:
Kernel patch against linux-2.6.11-gentoo-r9
Filename:
MIME Type:
Creator:
crusaderky
Created:
2005-06-08 11:07:00 UTC
Size:
27.62 KB
patch
obsolete
>--- drivers/input/evdev.c 2005-06-06 15:58:05.000000000 +0200 >+++ drivers/input/evdev.c 2005-03-18 19:03:37.000000000 +0100 >@@ -403,7 +403,21 @@ > struct evdev *evdev; > int minor; > >- for (minor = 0; minor < EVDEV_MINORS && evdev_table[minor]; minor++); >+ for (minor = 0; minor < EVDEV_MINORS && evdev_table[minor]; minor++) { >+ if (!evdev_table[minor]->exist && evdev_table[minor]->open) /* reuse */ >+ { >+ evdev = evdev_table[minor]; >+ evdev->handle.dev = dev; >+ evdev->handle.handler = handler; >+ evdev->handle.private = evdev; /* should already be */ >+ evdev->exist = 1; >+ printk(KERN_INFO "evdev: reusing event%d for vendor/product 0x%x/0x%x\n", minor, dev->id.vendor, dev->id.product); >+ input_open_device(&evdev->handle); >+ wake_up_interruptible(&evdev->wait); >+ return &evdev->handle; >+ } >+ } >+ > if (minor == EVDEV_MINORS) { > printk(KERN_ERR "evdev: no more free evdev devices\n"); > return NULL; >--- drivers/usb/input/hid-core.c 2005-06-06 15:58:05.000000000 +0200 >+++ drivers/usb/input/hid-core.c 2005-06-07 19:44:26.000000000 +0200 >@@ -1406,7 +1406,10 @@ > #define USB_DEVICE_ID_WACOM_PL 0x0030 > #define USB_DEVICE_ID_WACOM_INTUOS2 0x0040 > #define USB_DEVICE_ID_WACOM_VOLITO 0x0060 >+#define USB_DEVICE_ID_WACOM_VOLITO2 0x0062 > #define USB_DEVICE_ID_WACOM_PTU 0x0003 >+#define USB_DEVICE_ID_WACOM_INTUOS3 0x00B0 >+#define USB_DEVICE_ID_WACOM_CINTIQ 0x003F > > #define USB_VENDOR_ID_KBGEAR 0x084e > #define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001 >@@ -1554,7 +1557,12 @@ > { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 5, HID_QUIRK_IGNORE }, > { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE }, > { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE }, >+ { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO2, HID_QUIRK_IGNORE }, > { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE }, >+ { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE }, >+ { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE }, >+ { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE }, >+ { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE }, > { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, > { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, > >--- drivers/input/mousedev.c 2005-06-06 15:58:05.000000000 +0200 >+++ drivers/input/mousedev.c 2005-03-18 19:03:40.000000000 +0100 >@@ -605,6 +605,9 @@ > struct mousedev *mousedev; > int minor = 0; > >+ /* Ignore all wacom tablets */ >+ if (dev->id.vendor == 0x56a) return NULL; >+ > for (minor = 0; minor < MOUSEDEV_MINORS && mousedev_table[minor]; minor++); > if (minor == MOUSEDEV_MINORS) { > printk(KERN_ERR "mousedev: no more free mousedev devices\n"); >--- drivers/usb/input/usbmouse.c 2005-06-06 15:58:05.000000000 +0200 >+++ drivers/usb/input/usbmouse.c 2005-03-18 19:03:44.000000000 +0100 >@@ -142,6 +142,12 @@ > if ((endpoint->bmAttributes & 3) != 3) > return -ENODEV; > >+ /* Wacom tablets match. Let wacom driver take care of it. */ >+ if (dev->descriptor.idVendor == 0x056a) >+ { >+ return -ENODEV; >+ } >+ > pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); > maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); > >--- drivers/usb/input/wacom.c 2005-06-06 15:58:05.000000000 +0200 >+++ drivers/usb/input/wacom.c 2005-06-07 19:46:17.000000000 +0200 >@@ -51,6 +51,16 @@ > * - Cleanups here and there > * v1.30.1 (pi) - Added Graphire3 support > * v1.40 (pc) - Add support for several new devices, fix eraser reporting, ... >+ * >+ * WARNING: THIS IS NOT PART OF THE OFFICIAL KERNEL TREE >+ * THIS IS FOR TESTING PURPOSES >+ * >+ * v1.40-2.6.11.3-pc-0.1 - initial release based on 2.6.11 >+ * - fixed a Graphire bug >+ * - added Intuos3 >+ * - added Cintiq 21UX >+ * v1.40-2.6.11.3-pc-0.2 - fixed an I3 bug >+ * > */ > > /* >@@ -72,7 +82,7 @@ > /* > * Version Information > */ >-#define DRIVER_VERSION "v1.30" >+#define DRIVER_VERSION "v1.40" > #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" > #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" > #define DRIVER_LICENSE "GPL" >@@ -83,6 +93,16 @@ > > #define USB_VENDOR_ID_WACOM 0x056a > >+enum { >+ PENPARTNER = 0, >+ GRAPHIRE, >+ PL, >+ INTUOS, >+ INTUOS3, >+ CINTIQ, >+ MAX_TYPE >+}; >+ > struct wacom_features { > char *name; > int pktlen; >@@ -141,8 +161,10 @@ > goto exit; > } > >- if (data[0] != 2) >+ if (data[0] != 2) { > dbg("wacom_pl_irq: received unknown report #%d", data[0]); >+ goto exit; >+ } > > prox = data[1] & 0x40; > >@@ -180,8 +202,8 @@ > wacom->tool[1] = BTN_TOOL_PEN; > } > input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ >- input_report_abs(dev, ABS_X, data[3] | ((__u32)data[2] << 7) | ((__u32)(data[1] & 0x03) << 14)); >- input_report_abs(dev, ABS_Y, data[6] | ((__u32)data[5] << 7) | ((__u32)(data[4] & 0x03) << 14)); >+ input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); >+ input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); > input_report_abs(dev, ABS_PRESSURE, pressure); > > input_report_key(dev, BTN_TOUCH, data[4] & 0x08); >@@ -233,6 +255,7 @@ > if (data[0] != 2) > { > printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]); >+ goto exit; > } > > input_regs(dev, regs); >@@ -246,9 +269,9 @@ > input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); > input_report_key(dev, BTN_TOUCH, data[1] & 0x01); > } >- input_report_abs(dev, ABS_X, data[3] << 8 | data[2]); >- input_report_abs(dev, ABS_Y, data[5] << 8 | data[4]); >- input_report_abs(dev, ABS_PRESSURE, (data[6]|data[7] << 8)); >+ input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); >+ input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4])); >+ input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); > input_report_key(dev, BTN_STYLUS, data[1] & 0x02); > input_report_key(dev, BTN_STYLUS2, data[1] & 0x10); > >@@ -283,10 +306,15 @@ > goto exit; > } > >+ if (data[0] != 2) { >+ printk(KERN_INFO "wacom_penpartner_irq: received unknown report #%d\n", data[0]); >+ goto exit; >+ } >+ > input_regs(dev, regs); > input_report_key(dev, BTN_TOOL_PEN, 1); >- input_report_abs(dev, ABS_X, le16_to_cpu(get_unaligned((__le16 *) &data[1]))); >- input_report_abs(dev, ABS_Y, le16_to_cpu(get_unaligned((__le16 *) &data[3]))); >+ input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[1])); >+ input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[3])); > input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127); > input_report_key(dev, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20)); > input_report_key(dev, BTN_STYLUS, (data[5] & 0x40)); >@@ -322,56 +350,52 @@ > goto exit; > } > >- /* check if we can handle the data */ >- if (data[0] == 99) >- goto exit; >- >- if (data[0] != 2) >+ if (data[0] != 2) { > dbg("wacom_graphire_irq: received unknown report #%d", data[0]); >- >- x = le16_to_cpu(*(__le16 *) &data[2]); >- y = le16_to_cpu(*(__le16 *) &data[4]); >+ goto exit; >+ } > > input_regs(dev, regs); > >- switch ((data[1] >> 5) & 3) { >- >- case 0: /* Pen */ >- input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x80); >- break; >- >- case 1: /* Rubber */ >- input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x80); >- break; >- >- case 2: /* Mouse with wheel */ >- input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); >- input_report_rel(dev, REL_WHEEL, (signed char) data[6]); >- /* fall through */ >- >- case 3: /* Mouse without wheel */ >- input_report_key(dev, BTN_TOOL_MOUSE, data[7] > 24); >- input_report_key(dev, BTN_LEFT, data[1] & 0x01); >- input_report_key(dev, BTN_RIGHT, data[1] & 0x02); >- input_report_abs(dev, ABS_DISTANCE, data[7]); >- >- input_report_abs(dev, ABS_X, x); >- input_report_abs(dev, ABS_Y, y); >+ if ( data[1] & 0x10 ) /* in prox */ >+ { >+ switch ((data[1] >> 5) & 3) { > >- input_sync(dev); >- goto exit; >+ case 0: /* Pen */ >+ wacom->tool[0] = BTN_TOOL_PEN; >+ break; >+ >+ case 1: /* Rubber */ >+ wacom->tool[0] = BTN_TOOL_RUBBER; >+ break; >+ >+ case 2: /* Mouse with wheel */ >+ input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); >+ input_report_rel(dev, REL_WHEEL, (signed char) data[6]); >+ /* fall through */ >+ >+ case 3: /* Mouse without wheel */ >+ wacom->tool[0] = BTN_TOOL_MOUSE; >+ input_report_key(dev, BTN_LEFT, data[1] & 0x01); >+ input_report_key(dev, BTN_RIGHT, data[1] & 0x02); >+ input_report_abs(dev, ABS_DISTANCE, data[7]); >+ break; >+ } > } > > if (data[1] & 0x80) { >+ 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_Y, y); > } >- >- 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_STYLUS, data[1] & 0x02); >- input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); >- >+ if (wacom->tool[0] != BTN_TOOL_MOUSE) { >+ 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_STYLUS, data[1] & 0x02); >+ input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); >+ } >+ input_report_key(dev, wacom->tool[0], data[1] & 0x10); > input_sync(dev); > > exit: >@@ -381,6 +405,121 @@ > __FUNCTION__, retval); > } > >+static int wacom_intuos_inout(struct urb *urb) >+{ >+ struct wacom *wacom = urb->context; >+ unsigned char *data = wacom->data; >+ struct input_dev *dev = &wacom->dev; >+ int idx; >+ >+ /* tool number */ >+ idx = data[1] & 0x01; >+ >+ /* Enter report */ >+ if ((data[1] & 0xfc) == 0xc0) >+ { >+ /* serial number of the tool */ >+ wacom->serial[idx] = ((data[3] & 0x0f) << 28) + >+ (data[4] << 20) + (data[5] << 12) + >+ (data[6] << 4) + (data[7] >> 4); >+ >+ switch ((data[2] << 4) | (data[3] >> 4)) { >+ case 0x812: /* Inking pen */ >+ case 0x801: /* Intuos3 Inking pen */ >+ case 0x012: >+ wacom->tool[idx] = BTN_TOOL_PENCIL; >+ break; >+ case 0x822: /* Pen */ >+ case 0x842: >+ case 0x852: >+ case 0x823: /* Intuos3 Grip Pen */ >+ case 0x813: /* Intuos3 Classic Pen */ >+ case 0x885: /* Intuos3 Marker Pen */ >+ case 0x022: >+ wacom->tool[idx] = BTN_TOOL_PEN; >+ break; >+ case 0x832: /* Stroke pen */ >+ case 0x032: >+ wacom->tool[idx] = BTN_TOOL_BRUSH; >+ break; >+ case 0x007: /* Mouse 4D and 2D */ >+ case 0x09c: >+ case 0x094: >+ case 0x017: /* Intuos3 2D Mouse */ >+ wacom->tool[idx] = BTN_TOOL_MOUSE; >+ break; >+ case 0x096: /* Lens cursor */ >+ case 0x097: /* Intuos3 Lens cursor */ >+ wacom->tool[idx] = BTN_TOOL_LENS; >+ break; >+ case 0x82a: /* Eraser */ >+ case 0x85a: >+ case 0x91a: >+ case 0xd1a: >+ case 0x0fa: >+ case 0x82b: /* Intuos3 Grip Pen Eraser */ >+ case 0x81b: /* Intuos3 Classic Pen Eraser */ >+ case 0x91b: /* Intuos3 Airbrush Eraser */ >+ wacom->tool[idx] = BTN_TOOL_RUBBER; >+ break; >+ case 0xd12: /* Airbrush */ >+ case 0x912: >+ case 0x112: >+ case 0x913: /* Intuos3 Airbrush */ >+ wacom->tool[idx] = BTN_TOOL_AIRBRUSH; >+ break; >+ default: /* Unknown tool */ >+ wacom->tool[idx] = BTN_TOOL_PEN; >+ } >+ input_report_key(dev, wacom->tool[idx], 1); >+ input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); >+ input_sync(dev); >+ return 1; >+ } >+ >+ /* Exit report */ >+ if ((data[1] & 0xfe) == 0x80) { >+ input_report_key(dev, wacom->tool[idx], 0); >+ input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); >+ input_sync(dev); >+ return 1; >+ } >+ >+ return 0; >+} >+ >+static void wacom_intuos_general(struct urb *urb) >+{ >+ struct wacom *wacom = urb->context; >+ unsigned char *data = wacom->data; >+ struct input_dev *dev = &wacom->dev; >+ unsigned int t; >+ >+ /* general pen packet */ >+ if ((data[1] & 0xb8) == 0xa0) >+ { >+ t = (data[6] << 2) | ((data[7] >> 6) & 3); >+ input_report_abs(dev, ABS_PRESSURE, t); >+ input_report_abs(dev, ABS_TILT_X, >+ ((data[7] << 1) & 0x7e) | (data[8] >> 7)); >+ input_report_abs(dev, ABS_TILT_Y, data[8] & 0x7f); >+ input_report_key(dev, BTN_STYLUS, data[1] & 2); >+ input_report_key(dev, BTN_STYLUS2, data[1] & 4); >+ input_report_key(dev, BTN_TOUCH, t > 10); >+ } >+ >+ /* airbrush second packet */ >+ if ((data[1] & 0xbc) == 0xb4) >+ { >+ input_report_abs(dev, ABS_WHEEL, >+ (data[6] << 2) | ((data[7] >> 6) & 3)); >+ input_report_abs(dev, ABS_TILT_X, >+ ((data[7] << 1) & 0x7e) | (data[8] >> 7)); >+ input_report_abs(dev, ABS_TILT_Y, data[8] & 0x7f); >+ } >+ return; >+} >+ > static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) > { > struct wacom *wacom = urb->context; >@@ -405,114 +544,121 @@ > goto exit; > } > >- if (data[0] != 2) >+ if (data[0] != 2 && data[0] != 5 && data[0] != 6 && data[0] != 12) { > dbg("wacom_intuos_irq: received unknown report #%d", data[0]); >+ goto exit; >+ } > > input_regs(dev, regs); > > /* tool number */ > idx = data[1] & 0x01; > >- if ((data[1] & 0xfc) == 0xc0) { /* Enter report */ >- >- wacom->serial[idx] = ((__u32)(data[3] & 0x0f) << 28) + /* serial number of the tool */ >- ((__u32)data[4] << 20) + ((__u32)data[5] << 12) + >- ((__u32)data[6] << 4) + (data[7] >> 4); >- >- switch (((__u32)data[2] << 4) | (data[3] >> 4)) { >- case 0x812: >- case 0x012: wacom->tool[idx] = BTN_TOOL_PENCIL; break; /* Inking pen */ >- case 0x822: >- case 0x842: >- case 0x852: >- case 0x022: wacom->tool[idx] = BTN_TOOL_PEN; break; /* Pen */ >- case 0x832: >- case 0x032: wacom->tool[idx] = BTN_TOOL_BRUSH; break; /* Stroke pen */ >- case 0x007: >- case 0x09c: >- case 0x094: wacom->tool[idx] = BTN_TOOL_MOUSE; break; /* Mouse 4D and 2D */ >- case 0x096: wacom->tool[idx] = BTN_TOOL_LENS; break; /* Lens cursor */ >- case 0x82a: >- case 0x85a: >- case 0x91a: >- case 0xd1a: >- case 0x0fa: wacom->tool[idx] = BTN_TOOL_RUBBER; break; /* Eraser */ >- case 0xd12: >- case 0x912: >- case 0x112: wacom->tool[idx] = BTN_TOOL_AIRBRUSH; break; /* Airbrush */ >- default: wacom->tool[idx] = BTN_TOOL_PEN; break; /* Unknown tool */ >+ /* pad packets. Works as a second tool and is always in prox */ >+ if (data[0] == 12) >+ { >+ /* initiate the pad as a device */ >+ if (wacom->tool[1] != BTN_TOOL_FINGER) >+ { >+ wacom->tool[1] = BTN_TOOL_FINGER; >+ input_report_key(dev, wacom->tool[1], 1); > } >- >- input_report_key(dev, wacom->tool[idx], 1); >- input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); >+ input_report_key(dev, BTN_0, (data[5] & 0x01)); >+ input_report_key(dev, BTN_1, (data[5] & 0x02)); >+ input_report_key(dev, BTN_2, (data[5] & 0x04)); >+ input_report_key(dev, BTN_3, (data[5] & 0x08)); >+ input_report_key(dev, BTN_4, (data[6] & 0x01)); >+ input_report_key(dev, BTN_5, (data[6] & 0x02)); >+ input_report_key(dev, BTN_6, (data[6] & 0x04)); >+ input_report_key(dev, BTN_7, (data[6] & 0x08)); >+ input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); >+ input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); >+ input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff); > input_sync(dev); > goto exit; > } > >- if ((data[1] & 0xfe) == 0x80) { /* Exit report */ >- input_report_key(dev, wacom->tool[idx], 0); >- input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); >- input_sync(dev); >- goto exit; >- } >+ /* process in/out prox events */ >+ if (wacom_intuos_inout(urb)) goto exit; > >- input_report_abs(dev, ABS_X, be16_to_cpu(*(__be16 *) &data[2])); >- input_report_abs(dev, ABS_Y, be16_to_cpu(*(__be16 *) &data[4])); >- input_report_abs(dev, ABS_DISTANCE, data[9]); >- >- if ((data[1] & 0xb8) == 0xa0) { /* general pen packet */ >- input_report_abs(dev, ABS_PRESSURE, t = ((__u32)data[6] << 2) | ((data[7] >> 6) & 3)); >- input_report_abs(dev, ABS_TILT_X, ((data[7] << 1) & 0x7e) | (data[8] >> 7)); >- input_report_abs(dev, ABS_TILT_Y, data[8] & 0x7f); >- input_report_key(dev, BTN_STYLUS, data[1] & 2); >- input_report_key(dev, BTN_STYLUS2, data[1] & 4); >- input_report_key(dev, BTN_TOUCH, t > 10); >- } >+ /* Cintiq doesn't send data when RDY bit isn't set */ >+ if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) return; > >- if ((data[1] & 0xbc) == 0xb4) { /* airbrush second packet */ >- input_report_abs(dev, ABS_WHEEL, ((__u32)data[6] << 2) | ((data[7] >> 6) & 3)); >- input_report_abs(dev, ABS_TILT_X, ((data[7] << 1) & 0x7e) | (data[8] >> 7)); >- input_report_abs(dev, ABS_TILT_Y, data[8] & 0x7f); >+ 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_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1)); >+ input_report_abs(dev, ABS_DISTANCE, ((data[9] >> 2) & 0x3f)); > } >- >- if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) { /* 4D mouse or Lens cursor packets */ >- >- if (data[1] & 0x02) { /* Rotation packet */ >- >- input_report_abs(dev, ABS_RZ, (data[7] & 0x20) ? >- ((__u32)data[6] << 3) | ((data[7] >> 5) & 7): >- (-(((__u32)data[6] << 3) | ((data[7] >> 5) & 7))) - 1); >- >- } else { >- >- if ((data[1] & 0x10) == 0) { /* 4D mouse packets */ >- >- input_report_key(dev, BTN_LEFT, data[8] & 0x01); >- input_report_key(dev, BTN_MIDDLE, data[8] & 0x02); >- input_report_key(dev, BTN_RIGHT, data[8] & 0x04); >- >- input_report_key(dev, BTN_SIDE, data[8] & 0x20); >- input_report_key(dev, BTN_EXTRA, data[8] & 0x10); >- input_report_abs(dev, ABS_THROTTLE, -((data[8] & 0x08) ? >- ((__u32)data[6] << 2) | ((data[7] >> 6) & 3) : >- -((__u32)data[6] << 2) | ((data[7] >> 6) & 3))); >- >- } else { >- if (wacom->tool[idx] == BTN_TOOL_MOUSE) { /* 2D mouse packets */ >- input_report_key(dev, BTN_LEFT, data[8] & 0x04); >- input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); >- input_report_key(dev, BTN_RIGHT, data[8] & 0x10); >- input_report_rel(dev, REL_WHEEL, >- (-(__u32)(data[8] & 0x01) + (__u32)((data[8] & 0x02) >> 1))); >- } >- else { /* Lens cursor packets */ >- input_report_key(dev, BTN_LEFT, data[8] & 0x01); >- input_report_key(dev, BTN_MIDDLE, data[8] & 0x02); >- input_report_key(dev, BTN_RIGHT, data[8] & 0x04); >- input_report_key(dev, BTN_SIDE, data[8] & 0x10); >- input_report_key(dev, BTN_EXTRA, data[8] & 0x08); >- } >+ else >+ { >+ input_report_abs(dev, ABS_X, be16_to_cpu(*(__be16 *) &data[2])); >+ input_report_abs(dev, ABS_Y, be16_to_cpu(*(__be16 *) &data[4])); >+ input_report_abs(dev, ABS_DISTANCE, ((data[9] >> 3) & 0x1f)); >+ } >+ >+ /* process general packets */ >+ wacom_intuos_general(urb); >+ >+ /* 4D mouse, 2D mouse, marker pen rotation, or Lens cursor packets */ >+ if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) { >+ /* Rotation packet */ >+ if (data[1] & 0x02) >+ { >+ if(wacom->features->type >= INTUOS3) >+ { >+ /* I3 marker pen rotation reported as wheel >+ * due to valuator limitation >+ */ >+ t = (data[6] << 3) | ((data[7] >> 5) & 7); >+ t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) : >+ ((t-1) / 2 + 450)) : (450 - t / 2) ; >+ input_report_abs(dev, ABS_WHEEL, t); >+ } >+ else >+ { >+ /* 4D mouse rotation packet */ >+ t = (data[6] << 3) | ((data[7] >> 5) & 7); >+ input_report_abs(dev, ABS_RZ, (data[7] & 0x20) ? >+ ((t - 1) / 2) : -t / 2); > } >+ } >+ /* 4D mouse packets */ >+ else if ( !(data[1] & 0x10) && wacom->features->type < INTUOS3) >+ { >+ input_report_key(dev, BTN_LEFT, data[8] & 0x01); >+ input_report_key(dev, BTN_MIDDLE, data[8] & 0x02); >+ input_report_key(dev, BTN_RIGHT, data[8] & 0x04); >+ >+ input_report_key(dev, BTN_SIDE, data[8] & 0x20); >+ input_report_key(dev, BTN_EXTRA, data[8] & 0x10); >+ t = (data[6] << 2) | ((data[7] >> 6) & 3); >+ input_report_abs(dev, ABS_THROTTLE, (data[8] & 0x08) ? -t : t); >+ } >+ /* 2D mouse packets */ >+ else if (wacom->tool[idx] == BTN_TOOL_MOUSE) >+ { >+ input_report_key(dev, BTN_LEFT, data[8] & 0x04); >+ input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); >+ input_report_key(dev, BTN_RIGHT, data[8] & 0x10); >+ input_report_rel(dev, REL_WHEEL, ((data[8] & 0x02) >> 1) >+ - (data[8] & 0x01)); >+ >+ /* I3 2D mouse side buttons */ >+ if (wacom->features->type == INTUOS3) >+ { >+ input_report_key(dev, BTN_SIDE, data[8] & 0x40); >+ input_report_key(dev, BTN_EXTRA, data[8] & 0x20); >+ } >+ } >+ /* Lens cursor packets */ >+ else if (wacom->features->type < INTUOS3) >+ { >+ input_report_key(dev, BTN_LEFT, data[8] & 0x01); >+ input_report_key(dev, BTN_MIDDLE, data[8] & 0x02); >+ input_report_key(dev, BTN_RIGHT, data[8] & 0x04); >+ input_report_key(dev, BTN_SIDE, data[8] & 0x10); >+ input_report_key(dev, BTN_EXTRA, data[8] & 0x08); > } > } > >@@ -528,31 +674,36 @@ > } > > static struct wacom_features wacom_features[] = { >- { "Wacom Penpartner", 7, 5040, 3780, 255, 32, 0, wacom_penpartner_irq }, >- { "Wacom Graphire", 8, 10206, 7422, 511, 32, 1, wacom_graphire_irq }, >- { "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 32, 1, wacom_graphire_irq }, >- { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 32, 1, wacom_graphire_irq }, >- { "Wacom Graphire3", 8, 10208, 7424, 511, 32, 1, wacom_graphire_irq }, >- { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 32, 1, wacom_graphire_irq }, >- { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom PL400", 8, 5408, 4056, 255, 32, 3, wacom_pl_irq }, >- { "Wacom PL500", 8, 6144, 4608, 255, 32, 3, wacom_pl_irq }, >- { "Wacom PL600", 8, 6126, 4604, 255, 32, 3, wacom_pl_irq }, >- { "Wacom PL600SX", 8, 6260, 5016, 255, 32, 3, wacom_pl_irq }, >- { "Wacom PL550", 8, 6144, 4608, 511, 32, 3, wacom_pl_irq }, >- { "Wacom PL800", 8, 7220, 5780, 511, 32, 3, wacom_pl_irq }, >- { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 15, 2, wacom_intuos_irq }, >- { "Wacom Volito", 8, 5104, 3712, 511, 32, 1, wacom_graphire_irq }, >- { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, 3, wacom_ptu_irq }, >- { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, 2, wacom_intuos_irq }, >+ { "Wacom Penpartner", 7, 5040, 3780, 255, 32, PENPARTNER, wacom_penpartner_irq }, >+ { "Wacom Graphire", 8, 10206, 7422, 511, 32, GRAPHIRE, wacom_graphire_irq }, >+ { "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 32, GRAPHIRE, wacom_graphire_irq }, >+ { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 32, GRAPHIRE, wacom_graphire_irq }, >+ { "Wacom Graphire3", 8, 10208, 7424, 511, 32, GRAPHIRE, wacom_graphire_irq }, >+ { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 32, GRAPHIRE, wacom_graphire_irq }, >+ { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom PL400", 8, 5408, 4056, 255, 32, PL, wacom_pl_irq }, >+ { "Wacom PL500", 8, 6144, 4608, 255, 32, PL, wacom_pl_irq }, >+ { "Wacom PL600", 8, 6126, 4604, 255, 32, PL, wacom_pl_irq }, >+ { "Wacom PL600SX", 8, 6260, 5016, 255, 32, PL, wacom_pl_irq }, >+ { "Wacom PL550", 8, 6144, 4608, 511, 32, PL, wacom_pl_irq }, >+ { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq }, >+ { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, >+ { "Wacom Volito", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq }, >+ { "Wacom Volito2", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq }, >+ { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, >+ { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq }, >+ { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq }, >+ { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq }, >+ { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq }, >+ { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, > { } > }; > >@@ -580,7 +731,12 @@ > { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x44) }, > { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x45) }, > { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, >- { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, >+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, >+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, >+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, >+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, >+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, >+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, > { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, > { } > }; >@@ -643,7 +799,7 @@ > wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); > > switch (wacom->features->type) { >- case 1: >+ case GRAPHIRE: > wacom->dev.evbit[0] |= BIT(EV_REL); > wacom->dev.relbit[0] |= BIT(REL_WHEEL); > wacom->dev.absbit[0] |= BIT(ABS_DISTANCE); >@@ -651,18 +807,25 @@ > wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_STYLUS2); > break; > >- case 2: >+ case INTUOS3: >+ case CINTIQ: >+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); >+ wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); >+ wacom->dev.absbit[0] |= BIT(ABS_RX) | BIT(ABS_RY); >+ /* fall through */ >+ >+ case INTUOS: > wacom->dev.evbit[0] |= BIT(EV_MSC) | BIT(EV_REL); > wacom->dev.mscbit[0] |= BIT(MSC_SERIAL); > wacom->dev.relbit[0] |= BIT(REL_WHEEL); > wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA); >- wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH) >+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH) > | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2); > wacom->dev.absbit[0] |= BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE); > break; > >- case 3: >- wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2); >+ case PL: >+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2) | BIT(BTN_TOOL_RUBBER); > break; > } > >@@ -674,6 +837,8 @@ > wacom->dev.absmax[ABS_TILT_Y] = 127; > wacom->dev.absmax[ABS_WHEEL] = 1023; > >+ wacom->dev.absmax[ABS_RX] = 4097; >+ wacom->dev.absmax[ABS_RY] = 4097; > wacom->dev.absmin[ABS_RZ] = -900; > wacom->dev.absmax[ABS_RZ] = 899; > wacom->dev.absmin[ABS_THROTTLE] = -1023; >@@ -712,9 +877,10 @@ > > input_register_device(&wacom->dev); > >+ /* ask the tablet to report tablet data */ >+ usb_set_report(intf, 3, 2, rep_data, 2); >+ /* repeat once (not sure why the first call often fails) */ > usb_set_report(intf, 3, 2, rep_data, 2); >- usb_set_report(intf, 3, 5, rep_data, 0); >- usb_set_report(intf, 3, 6, rep_data, 0); > > printk(KERN_INFO "input: %s on %s\n", wacom->features->name, path); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 95478
:
60852
|
60853
|
60854
|
62841
|
70236
|
70238
|
70385