Path: blob/master/drivers/input/tablet/wacom_wac.c
15112 views
/*1* drivers/input/tablet/wacom_wac.c2*3* USB Wacom tablet support - Wacom specific code4*5*/67/*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*/1314#include "wacom_wac.h"15#include "wacom.h"16#include <linux/input/mt.h>1718/* resolution for penabled devices */19#define WACOM_PL_RES 2020#define WACOM_PENPRTN_RES 4021#define WACOM_VOLITO_RES 5022#define WACOM_GRAPHIRE_RES 8023#define WACOM_INTUOS_RES 10024#define WACOM_INTUOS3_RES 2002526static int wacom_penpartner_irq(struct wacom_wac *wacom)27{28unsigned char *data = wacom->data;29struct input_dev *input = wacom->input;3031switch (data[0]) {32case 1:33if (data[5] & 0x80) {34wacom->tool[0] = (data[5] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;35wacom->id[0] = (data[5] & 0x20) ? ERASER_DEVICE_ID : STYLUS_DEVICE_ID;36input_report_key(input, wacom->tool[0], 1);37input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */38input_report_abs(input, ABS_X, get_unaligned_le16(&data[1]));39input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3]));40input_report_abs(input, ABS_PRESSURE, (signed char)data[6] + 127);41input_report_key(input, BTN_TOUCH, ((signed char)data[6] > -127));42input_report_key(input, BTN_STYLUS, (data[5] & 0x40));43} else {44input_report_key(input, wacom->tool[0], 0);45input_report_abs(input, ABS_MISC, 0); /* report tool id */46input_report_abs(input, ABS_PRESSURE, -1);47input_report_key(input, BTN_TOUCH, 0);48}49break;5051case 2:52input_report_key(input, BTN_TOOL_PEN, 1);53input_report_abs(input, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */54input_report_abs(input, ABS_X, get_unaligned_le16(&data[1]));55input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3]));56input_report_abs(input, ABS_PRESSURE, (signed char)data[6] + 127);57input_report_key(input, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20));58input_report_key(input, BTN_STYLUS, (data[5] & 0x40));59break;6061default:62printk(KERN_INFO "wacom_penpartner_irq: received unknown report #%d\n", data[0]);63return 0;64}6566return 1;67}6869static int wacom_pl_irq(struct wacom_wac *wacom)70{71struct wacom_features *features = &wacom->features;72unsigned char *data = wacom->data;73struct input_dev *input = wacom->input;74int prox, pressure;7576if (data[0] != WACOM_REPORT_PENABLED) {77dbg("wacom_pl_irq: received unknown report #%d", data[0]);78return 0;79}8081prox = data[1] & 0x40;8283if (prox) {84wacom->id[0] = ERASER_DEVICE_ID;85pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1));86if (features->pressure_max > 255)87pressure = (pressure << 1) | ((data[4] >> 6) & 1);88pressure += (features->pressure_max + 1) / 2;8990/*91* if going from out of proximity into proximity select between the eraser92* and the pen based on the state of the stylus2 button, choose eraser if93* pressed else choose pen. if not a proximity change from out to in, send94* an out of proximity for previous tool then a in for new tool.95*/96if (!wacom->tool[0]) {97/* Eraser bit set for DTF */98if (data[1] & 0x10)99wacom->tool[1] = BTN_TOOL_RUBBER;100else101/* Going into proximity select tool */102wacom->tool[1] = (data[4] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;103} else {104/* was entered with stylus2 pressed */105if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20)) {106/* report out proximity for previous tool */107input_report_key(input, wacom->tool[1], 0);108input_sync(input);109wacom->tool[1] = BTN_TOOL_PEN;110return 0;111}112}113if (wacom->tool[1] != BTN_TOOL_RUBBER) {114/* Unknown tool selected default to pen tool */115wacom->tool[1] = BTN_TOOL_PEN;116wacom->id[0] = STYLUS_DEVICE_ID;117}118input_report_key(input, wacom->tool[1], prox); /* report in proximity for tool */119input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */120input_report_abs(input, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14));121input_report_abs(input, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14));122input_report_abs(input, ABS_PRESSURE, pressure);123124input_report_key(input, BTN_TOUCH, data[4] & 0x08);125input_report_key(input, BTN_STYLUS, data[4] & 0x10);126/* Only allow the stylus2 button to be reported for the pen tool. */127input_report_key(input, BTN_STYLUS2, (wacom->tool[1] == BTN_TOOL_PEN) && (data[4] & 0x20));128} else {129/* report proximity-out of a (valid) tool */130if (wacom->tool[1] != BTN_TOOL_RUBBER) {131/* Unknown tool selected default to pen tool */132wacom->tool[1] = BTN_TOOL_PEN;133}134input_report_key(input, wacom->tool[1], prox);135}136137wacom->tool[0] = prox; /* Save proximity state */138return 1;139}140141static int wacom_ptu_irq(struct wacom_wac *wacom)142{143unsigned char *data = wacom->data;144struct input_dev *input = wacom->input;145146if (data[0] != WACOM_REPORT_PENABLED) {147printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]);148return 0;149}150151if (data[1] & 0x04) {152input_report_key(input, BTN_TOOL_RUBBER, data[1] & 0x20);153input_report_key(input, BTN_TOUCH, data[1] & 0x08);154wacom->id[0] = ERASER_DEVICE_ID;155} else {156input_report_key(input, BTN_TOOL_PEN, data[1] & 0x20);157input_report_key(input, BTN_TOUCH, data[1] & 0x01);158wacom->id[0] = STYLUS_DEVICE_ID;159}160input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */161input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));162input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));163input_report_abs(input, ABS_PRESSURE, le16_to_cpup((__le16 *)&data[6]));164input_report_key(input, BTN_STYLUS, data[1] & 0x02);165input_report_key(input, BTN_STYLUS2, data[1] & 0x10);166return 1;167}168169static int wacom_dtu_irq(struct wacom_wac *wacom)170{171struct wacom_features *features = &wacom->features;172char *data = wacom->data;173struct input_dev *input = wacom->input;174int prox = data[1] & 0x20, pressure;175176dbg("wacom_dtu_irq: received report #%d", data[0]);177178if (prox) {179/* Going into proximity select tool */180wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;181if (wacom->tool[0] == BTN_TOOL_PEN)182wacom->id[0] = STYLUS_DEVICE_ID;183else184wacom->id[0] = ERASER_DEVICE_ID;185}186input_report_key(input, BTN_STYLUS, data[1] & 0x02);187input_report_key(input, BTN_STYLUS2, data[1] & 0x10);188input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));189input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));190pressure = ((data[7] & 0x01) << 8) | data[6];191if (pressure < 0)192pressure = features->pressure_max + pressure + 1;193input_report_abs(input, ABS_PRESSURE, pressure);194input_report_key(input, BTN_TOUCH, data[1] & 0x05);195if (!prox) /* out-prox */196wacom->id[0] = 0;197input_report_key(input, wacom->tool[0], prox);198input_report_abs(input, ABS_MISC, wacom->id[0]);199return 1;200}201202static int wacom_graphire_irq(struct wacom_wac *wacom)203{204struct wacom_features *features = &wacom->features;205unsigned char *data = wacom->data;206struct input_dev *input = wacom->input;207int prox;208int rw = 0;209int retval = 0;210211if (data[0] != WACOM_REPORT_PENABLED) {212dbg("wacom_graphire_irq: received unknown report #%d", data[0]);213goto exit;214}215216prox = data[1] & 0x80;217if (prox || wacom->id[0]) {218if (prox) {219switch ((data[1] >> 5) & 3) {220221case 0: /* Pen */222wacom->tool[0] = BTN_TOOL_PEN;223wacom->id[0] = STYLUS_DEVICE_ID;224break;225226case 1: /* Rubber */227wacom->tool[0] = BTN_TOOL_RUBBER;228wacom->id[0] = ERASER_DEVICE_ID;229break;230231case 2: /* Mouse with wheel */232input_report_key(input, BTN_MIDDLE, data[1] & 0x04);233/* fall through */234235case 3: /* Mouse without wheel */236wacom->tool[0] = BTN_TOOL_MOUSE;237wacom->id[0] = CURSOR_DEVICE_ID;238break;239}240}241input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));242input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));243if (wacom->tool[0] != BTN_TOOL_MOUSE) {244input_report_abs(input, ABS_PRESSURE, data[6] | ((data[7] & 0x01) << 8));245input_report_key(input, BTN_TOUCH, data[1] & 0x01);246input_report_key(input, BTN_STYLUS, data[1] & 0x02);247input_report_key(input, BTN_STYLUS2, data[1] & 0x04);248} else {249input_report_key(input, BTN_LEFT, data[1] & 0x01);250input_report_key(input, BTN_RIGHT, data[1] & 0x02);251if (features->type == WACOM_G4 ||252features->type == WACOM_MO) {253input_report_abs(input, ABS_DISTANCE, data[6] & 0x3f);254rw = (data[7] & 0x04) - (data[7] & 0x03);255} else {256input_report_abs(input, ABS_DISTANCE, data[7] & 0x3f);257rw = -(signed char)data[6];258}259input_report_rel(input, REL_WHEEL, rw);260}261262if (!prox)263wacom->id[0] = 0;264input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */265input_report_key(input, wacom->tool[0], prox);266input_sync(input); /* sync last event */267}268269/* send pad data */270switch (features->type) {271case WACOM_G4:272prox = data[7] & 0xf8;273if (prox || wacom->id[1]) {274wacom->id[1] = PAD_DEVICE_ID;275input_report_key(input, BTN_0, (data[7] & 0x40));276input_report_key(input, BTN_4, (data[7] & 0x80));277rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);278input_report_rel(input, REL_WHEEL, rw);279input_report_key(input, BTN_TOOL_FINGER, 0xf0);280if (!prox)281wacom->id[1] = 0;282input_report_abs(input, ABS_MISC, wacom->id[1]);283input_event(input, EV_MSC, MSC_SERIAL, 0xf0);284retval = 1;285}286break;287288case WACOM_MO:289prox = (data[7] & 0xf8) || data[8];290if (prox || wacom->id[1]) {291wacom->id[1] = PAD_DEVICE_ID;292input_report_key(input, BTN_0, (data[7] & 0x08));293input_report_key(input, BTN_1, (data[7] & 0x20));294input_report_key(input, BTN_4, (data[7] & 0x10));295input_report_key(input, BTN_5, (data[7] & 0x40));296input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f));297input_report_key(input, BTN_TOOL_FINGER, 0xf0);298if (!prox)299wacom->id[1] = 0;300input_report_abs(input, ABS_MISC, wacom->id[1]);301input_event(input, EV_MSC, MSC_SERIAL, 0xf0);302}303retval = 1;304break;305}306exit:307return retval;308}309310static int wacom_intuos_inout(struct wacom_wac *wacom)311{312struct wacom_features *features = &wacom->features;313unsigned char *data = wacom->data;314struct input_dev *input = wacom->input;315int idx = 0;316317/* tool number */318if (features->type == INTUOS)319idx = data[1] & 0x01;320321/* Enter report */322if ((data[1] & 0xfc) == 0xc0) {323/* serial number of the tool */324wacom->serial[idx] = ((data[3] & 0x0f) << 28) +325(data[4] << 20) + (data[5] << 12) +326(data[6] << 4) + (data[7] >> 4);327328wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) |329((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12);330331switch (wacom->id[idx] & 0xfffff) {332case 0x812: /* Inking pen */333case 0x801: /* Intuos3 Inking pen */334case 0x20802: /* Intuos4 Inking Pen */335case 0x012:336wacom->tool[idx] = BTN_TOOL_PENCIL;337break;338339case 0x822: /* Pen */340case 0x842:341case 0x852:342case 0x823: /* Intuos3 Grip Pen */343case 0x813: /* Intuos3 Classic Pen */344case 0x885: /* Intuos3 Marker Pen */345case 0x802: /* Intuos4 General Pen */346case 0x804: /* Intuos4 Marker Pen */347case 0x40802: /* Intuos4 Classic Pen */348case 0x022:349wacom->tool[idx] = BTN_TOOL_PEN;350break;351352case 0x832: /* Stroke pen */353case 0x032:354wacom->tool[idx] = BTN_TOOL_BRUSH;355break;356357case 0x007: /* Mouse 4D and 2D */358case 0x09c:359case 0x094:360case 0x017: /* Intuos3 2D Mouse */361case 0x806: /* Intuos4 Mouse */362wacom->tool[idx] = BTN_TOOL_MOUSE;363break;364365case 0x096: /* Lens cursor */366case 0x097: /* Intuos3 Lens cursor */367case 0x006: /* Intuos4 Lens cursor */368wacom->tool[idx] = BTN_TOOL_LENS;369break;370371case 0x82a: /* Eraser */372case 0x85a:373case 0x91a:374case 0xd1a:375case 0x0fa:376case 0x82b: /* Intuos3 Grip Pen Eraser */377case 0x81b: /* Intuos3 Classic Pen Eraser */378case 0x91b: /* Intuos3 Airbrush Eraser */379case 0x80c: /* Intuos4 Marker Pen Eraser */380case 0x80a: /* Intuos4 General Pen Eraser */381case 0x4080a: /* Intuos4 Classic Pen Eraser */382case 0x90a: /* Intuos4 Airbrush Eraser */383wacom->tool[idx] = BTN_TOOL_RUBBER;384break;385386case 0xd12:387case 0x912:388case 0x112:389case 0x913: /* Intuos3 Airbrush */390case 0x902: /* Intuos4 Airbrush */391wacom->tool[idx] = BTN_TOOL_AIRBRUSH;392break;393394default: /* Unknown tool */395wacom->tool[idx] = BTN_TOOL_PEN;396break;397}398return 1;399}400401/* older I4 styli don't work with new Cintiqs */402if (!((wacom->id[idx] >> 20) & 0x01) &&403(features->type == WACOM_21UX2))404return 1;405406/* Exit report */407if ((data[1] & 0xfe) == 0x80) {408/*409* Reset all states otherwise we lose the initial states410* when in-prox next time411*/412input_report_abs(input, ABS_X, 0);413input_report_abs(input, ABS_Y, 0);414input_report_abs(input, ABS_DISTANCE, 0);415input_report_abs(input, ABS_TILT_X, 0);416input_report_abs(input, ABS_TILT_Y, 0);417if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {418input_report_key(input, BTN_LEFT, 0);419input_report_key(input, BTN_MIDDLE, 0);420input_report_key(input, BTN_RIGHT, 0);421input_report_key(input, BTN_SIDE, 0);422input_report_key(input, BTN_EXTRA, 0);423input_report_abs(input, ABS_THROTTLE, 0);424input_report_abs(input, ABS_RZ, 0);425} else {426input_report_abs(input, ABS_PRESSURE, 0);427input_report_key(input, BTN_STYLUS, 0);428input_report_key(input, BTN_STYLUS2, 0);429input_report_key(input, BTN_TOUCH, 0);430input_report_abs(input, ABS_WHEEL, 0);431if (features->type >= INTUOS3S)432input_report_abs(input, ABS_Z, 0);433}434input_report_key(input, wacom->tool[idx], 0);435input_report_abs(input, ABS_MISC, 0); /* reset tool id */436input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]);437wacom->id[idx] = 0;438return 2;439}440return 0;441}442443static void wacom_intuos_general(struct wacom_wac *wacom)444{445struct wacom_features *features = &wacom->features;446unsigned char *data = wacom->data;447struct input_dev *input = wacom->input;448unsigned int t;449450/* general pen packet */451if ((data[1] & 0xb8) == 0xa0) {452t = (data[6] << 2) | ((data[7] >> 6) & 3);453if ((features->type >= INTUOS4S && features->type <= INTUOS4L) ||454features->type == WACOM_21UX2) {455t = (t << 1) | (data[1] & 1);456}457input_report_abs(input, ABS_PRESSURE, t);458input_report_abs(input, ABS_TILT_X,459((data[7] << 1) & 0x7e) | (data[8] >> 7));460input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f);461input_report_key(input, BTN_STYLUS, data[1] & 2);462input_report_key(input, BTN_STYLUS2, data[1] & 4);463input_report_key(input, BTN_TOUCH, t > 10);464}465466/* airbrush second packet */467if ((data[1] & 0xbc) == 0xb4) {468input_report_abs(input, ABS_WHEEL,469(data[6] << 2) | ((data[7] >> 6) & 3));470input_report_abs(input, ABS_TILT_X,471((data[7] << 1) & 0x7e) | (data[8] >> 7));472input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f);473}474}475476static int wacom_intuos_irq(struct wacom_wac *wacom)477{478struct wacom_features *features = &wacom->features;479unsigned char *data = wacom->data;480struct input_dev *input = wacom->input;481unsigned int t;482int idx = 0, result;483484if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD485&& data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) {486dbg("wacom_intuos_irq: received unknown report #%d", data[0]);487return 0;488}489490/* tool number */491if (features->type == INTUOS)492idx = data[1] & 0x01;493494/* pad packets. Works as a second tool and is always in prox */495if (data[0] == WACOM_REPORT_INTUOSPAD) {496/* initiate the pad as a device */497if (wacom->tool[1] != BTN_TOOL_FINGER)498wacom->tool[1] = BTN_TOOL_FINGER;499500if (features->type >= INTUOS4S && features->type <= INTUOS4L) {501input_report_key(input, BTN_0, (data[2] & 0x01));502input_report_key(input, BTN_1, (data[3] & 0x01));503input_report_key(input, BTN_2, (data[3] & 0x02));504input_report_key(input, BTN_3, (data[3] & 0x04));505input_report_key(input, BTN_4, (data[3] & 0x08));506input_report_key(input, BTN_5, (data[3] & 0x10));507input_report_key(input, BTN_6, (data[3] & 0x20));508if (data[1] & 0x80) {509input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f));510} else {511/* Out of proximity, clear wheel value. */512input_report_abs(input, ABS_WHEEL, 0);513}514if (features->type != INTUOS4S) {515input_report_key(input, BTN_7, (data[3] & 0x40));516input_report_key(input, BTN_8, (data[3] & 0x80));517}518if (data[1] | (data[2] & 0x01) | data[3]) {519input_report_key(input, wacom->tool[1], 1);520input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);521} else {522input_report_key(input, wacom->tool[1], 0);523input_report_abs(input, ABS_MISC, 0);524}525} else {526if (features->type == WACOM_21UX2) {527input_report_key(input, BTN_0, (data[5] & 0x01));528input_report_key(input, BTN_1, (data[6] & 0x01));529input_report_key(input, BTN_2, (data[6] & 0x02));530input_report_key(input, BTN_3, (data[6] & 0x04));531input_report_key(input, BTN_4, (data[6] & 0x08));532input_report_key(input, BTN_5, (data[6] & 0x10));533input_report_key(input, BTN_6, (data[6] & 0x20));534input_report_key(input, BTN_7, (data[6] & 0x40));535input_report_key(input, BTN_8, (data[6] & 0x80));536input_report_key(input, BTN_9, (data[7] & 0x01));537input_report_key(input, BTN_A, (data[8] & 0x01));538input_report_key(input, BTN_B, (data[8] & 0x02));539input_report_key(input, BTN_C, (data[8] & 0x04));540input_report_key(input, BTN_X, (data[8] & 0x08));541input_report_key(input, BTN_Y, (data[8] & 0x10));542input_report_key(input, BTN_Z, (data[8] & 0x20));543input_report_key(input, BTN_BASE, (data[8] & 0x40));544input_report_key(input, BTN_BASE2, (data[8] & 0x80));545} else {546input_report_key(input, BTN_0, (data[5] & 0x01));547input_report_key(input, BTN_1, (data[5] & 0x02));548input_report_key(input, BTN_2, (data[5] & 0x04));549input_report_key(input, BTN_3, (data[5] & 0x08));550input_report_key(input, BTN_4, (data[6] & 0x01));551input_report_key(input, BTN_5, (data[6] & 0x02));552input_report_key(input, BTN_6, (data[6] & 0x04));553input_report_key(input, BTN_7, (data[6] & 0x08));554input_report_key(input, BTN_8, (data[5] & 0x10));555input_report_key(input, BTN_9, (data[6] & 0x10));556}557input_report_abs(input, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);558input_report_abs(input, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);559560if ((data[5] & 0x1f) | data[6] | (data[1] & 0x1f) |561data[2] | (data[3] & 0x1f) | data[4] | data[8] |562(data[7] & 0x01)) {563input_report_key(input, wacom->tool[1], 1);564input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);565} else {566input_report_key(input, wacom->tool[1], 0);567input_report_abs(input, ABS_MISC, 0);568}569}570input_event(input, EV_MSC, MSC_SERIAL, 0xffffffff);571return 1;572}573574/* process in/out prox events */575result = wacom_intuos_inout(wacom);576if (result)577return result - 1;578579/* don't proceed if we don't know the ID */580if (!wacom->id[idx])581return 0;582583/* Only large Intuos support Lense Cursor */584if (wacom->tool[idx] == BTN_TOOL_LENS &&585(features->type == INTUOS3 ||586features->type == INTUOS3S ||587features->type == INTUOS4 ||588features->type == INTUOS4S)) {589590return 0;591}592593/* Cintiq doesn't send data when RDY bit isn't set */594if (features->type == CINTIQ && !(data[1] & 0x40))595return 0;596597if (features->type >= INTUOS3S) {598input_report_abs(input, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1));599input_report_abs(input, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1));600input_report_abs(input, ABS_DISTANCE, ((data[9] >> 2) & 0x3f));601} else {602input_report_abs(input, ABS_X, be16_to_cpup((__be16 *)&data[2]));603input_report_abs(input, ABS_Y, be16_to_cpup((__be16 *)&data[4]));604input_report_abs(input, ABS_DISTANCE, ((data[9] >> 3) & 0x1f));605}606607/* process general packets */608wacom_intuos_general(wacom);609610/* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */611if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0 || (data[1] & 0xbc) == 0xac) {612613if (data[1] & 0x02) {614/* Rotation packet */615if (features->type >= INTUOS3S) {616/* I3 marker pen rotation */617t = (data[6] << 3) | ((data[7] >> 5) & 7);618t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) :619((t-1) / 2 + 450)) : (450 - t / 2) ;620input_report_abs(input, ABS_Z, t);621} else {622/* 4D mouse rotation packet */623t = (data[6] << 3) | ((data[7] >> 5) & 7);624input_report_abs(input, ABS_RZ, (data[7] & 0x20) ?625((t - 1) / 2) : -t / 2);626}627628} else if (!(data[1] & 0x10) && features->type < INTUOS3S) {629/* 4D mouse packet */630input_report_key(input, BTN_LEFT, data[8] & 0x01);631input_report_key(input, BTN_MIDDLE, data[8] & 0x02);632input_report_key(input, BTN_RIGHT, data[8] & 0x04);633634input_report_key(input, BTN_SIDE, data[8] & 0x20);635input_report_key(input, BTN_EXTRA, data[8] & 0x10);636t = (data[6] << 2) | ((data[7] >> 6) & 3);637input_report_abs(input, ABS_THROTTLE, (data[8] & 0x08) ? -t : t);638639} else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {640/* I4 mouse */641if (features->type >= INTUOS4S && features->type <= INTUOS4L) {642input_report_key(input, BTN_LEFT, data[6] & 0x01);643input_report_key(input, BTN_MIDDLE, data[6] & 0x02);644input_report_key(input, BTN_RIGHT, data[6] & 0x04);645input_report_rel(input, REL_WHEEL, ((data[7] & 0x80) >> 7)646- ((data[7] & 0x40) >> 6));647input_report_key(input, BTN_SIDE, data[6] & 0x08);648input_report_key(input, BTN_EXTRA, data[6] & 0x10);649650input_report_abs(input, ABS_TILT_X,651((data[7] << 1) & 0x7e) | (data[8] >> 7));652input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f);653} else {654/* 2D mouse packet */655input_report_key(input, BTN_LEFT, data[8] & 0x04);656input_report_key(input, BTN_MIDDLE, data[8] & 0x08);657input_report_key(input, BTN_RIGHT, data[8] & 0x10);658input_report_rel(input, REL_WHEEL, (data[8] & 0x01)659- ((data[8] & 0x02) >> 1));660661/* I3 2D mouse side buttons */662if (features->type >= INTUOS3S && features->type <= INTUOS3L) {663input_report_key(input, BTN_SIDE, data[8] & 0x40);664input_report_key(input, BTN_EXTRA, data[8] & 0x20);665}666}667} else if ((features->type < INTUOS3S || features->type == INTUOS3L ||668features->type == INTUOS4L) &&669wacom->tool[idx] == BTN_TOOL_LENS) {670/* Lens cursor packets */671input_report_key(input, BTN_LEFT, data[8] & 0x01);672input_report_key(input, BTN_MIDDLE, data[8] & 0x02);673input_report_key(input, BTN_RIGHT, data[8] & 0x04);674input_report_key(input, BTN_SIDE, data[8] & 0x10);675input_report_key(input, BTN_EXTRA, data[8] & 0x08);676}677}678679input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */680input_report_key(input, wacom->tool[idx], 1);681input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]);682return 1;683}684685static int wacom_tpc_mt_touch(struct wacom_wac *wacom)686{687struct input_dev *input = wacom->input;688unsigned char *data = wacom->data;689int contact_with_no_pen_down_count = 0;690int i;691692for (i = 0; i < 2; i++) {693int p = data[1] & (1 << i);694bool touch = p && !wacom->shared->stylus_in_proximity;695696input_mt_slot(input, i);697input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);698if (touch) {699int x = le16_to_cpup((__le16 *)&data[i * 2 + 2]) & 0x7fff;700int y = le16_to_cpup((__le16 *)&data[i * 2 + 6]) & 0x7fff;701702input_report_abs(input, ABS_MT_POSITION_X, x);703input_report_abs(input, ABS_MT_POSITION_Y, y);704contact_with_no_pen_down_count++;705}706}707708/* keep touch state for pen event */709wacom->shared->touch_down = (contact_with_no_pen_down_count > 0);710711input_mt_report_pointer_emulation(input, true);712713return 1;714}715716static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len)717{718char *data = wacom->data;719struct input_dev *input = wacom->input;720bool prox;721int x = 0, y = 0;722723if (!wacom->shared->stylus_in_proximity) {724if (len == WACOM_PKGLEN_TPC1FG) {725prox = data[0] & 0x01;726x = get_unaligned_le16(&data[1]);727y = get_unaligned_le16(&data[3]);728} else { /* with capacity */729prox = data[1] & 0x01;730x = le16_to_cpup((__le16 *)&data[2]);731y = le16_to_cpup((__le16 *)&data[4]);732}733} else734/* force touch out when pen is in prox */735prox = 0;736737if (prox) {738input_report_abs(input, ABS_X, x);739input_report_abs(input, ABS_Y, y);740}741input_report_key(input, BTN_TOUCH, prox);742743/* keep touch state for pen events */744wacom->shared->touch_down = prox;745746return 1;747}748749static int wacom_tpc_pen(struct wacom_wac *wacom)750{751struct wacom_features *features = &wacom->features;752char *data = wacom->data;753struct input_dev *input = wacom->input;754int pressure;755bool prox = data[1] & 0x20;756757if (!wacom->shared->stylus_in_proximity) /* first in prox */758/* Going into proximity select tool */759wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;760761/* keep pen state for touch events */762wacom->shared->stylus_in_proximity = prox;763764/* send pen events only when touch is up or forced out */765if (!wacom->shared->touch_down) {766input_report_key(input, BTN_STYLUS, data[1] & 0x02);767input_report_key(input, BTN_STYLUS2, data[1] & 0x10);768input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));769input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));770pressure = ((data[7] & 0x01) << 8) | data[6];771if (pressure < 0)772pressure = features->pressure_max + pressure + 1;773input_report_abs(input, ABS_PRESSURE, pressure);774input_report_key(input, BTN_TOUCH, data[1] & 0x05);775input_report_key(input, wacom->tool[0], prox);776return 1;777}778779return 0;780}781782static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)783{784char *data = wacom->data;785786dbg("wacom_tpc_irq: received report #%d", data[0]);787788if (len == WACOM_PKGLEN_TPC1FG || data[0] == WACOM_REPORT_TPC1FG)789return wacom_tpc_single_touch(wacom, len);790else if (data[0] == WACOM_REPORT_TPC2FG)791return wacom_tpc_mt_touch(wacom);792else if (data[0] == WACOM_REPORT_PENABLED)793return wacom_tpc_pen(wacom);794795return 0;796}797798static int wacom_bpt_touch(struct wacom_wac *wacom)799{800struct wacom_features *features = &wacom->features;801struct input_dev *input = wacom->input;802unsigned char *data = wacom->data;803int i;804805for (i = 0; i < 2; i++) {806int p = data[9 * i + 2];807bool touch = p && !wacom->shared->stylus_in_proximity;808809input_mt_slot(input, i);810input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);811/*812* Touch events need to be disabled while stylus is813* in proximity because user's hand is resting on touchpad814* and sending unwanted events. User expects tablet buttons815* to continue working though.816*/817if (touch) {818int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;819int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;820if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {821x <<= 5;822y <<= 5;823}824input_report_abs(input, ABS_MT_PRESSURE, p);825input_report_abs(input, ABS_MT_POSITION_X, x);826input_report_abs(input, ABS_MT_POSITION_Y, y);827}828}829830input_mt_report_pointer_emulation(input, true);831832input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);833input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);834input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);835input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);836837input_sync(input);838839return 0;840}841842static int wacom_bpt_pen(struct wacom_wac *wacom)843{844struct input_dev *input = wacom->input;845unsigned char *data = wacom->data;846int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;847848/*849* Similar to Graphire protocol, data[1] & 0x20 is proximity and850* data[1] & 0x18 is tool ID. 0x30 is safety check to ignore851* 2 unused tool ID's.852*/853prox = (data[1] & 0x30) == 0x30;854855/*856* All reports shared between PEN and RUBBER tool must be857* forced to a known starting value (zero) when transitioning to858* out-of-prox.859*860* If not reset then, to userspace, it will look like lost events861* if new tool comes in-prox with same values as previous tool sent.862*863* Hardware does report zero in most out-of-prox cases but not all.864*/865if (prox) {866if (!wacom->shared->stylus_in_proximity) {867if (data[1] & 0x08) {868wacom->tool[0] = BTN_TOOL_RUBBER;869wacom->id[0] = ERASER_DEVICE_ID;870} else {871wacom->tool[0] = BTN_TOOL_PEN;872wacom->id[0] = STYLUS_DEVICE_ID;873}874wacom->shared->stylus_in_proximity = true;875}876x = le16_to_cpup((__le16 *)&data[2]);877y = le16_to_cpup((__le16 *)&data[4]);878p = le16_to_cpup((__le16 *)&data[6]);879d = data[8];880pen = data[1] & 0x01;881btn1 = data[1] & 0x02;882btn2 = data[1] & 0x04;883}884885input_report_key(input, BTN_TOUCH, pen);886input_report_key(input, BTN_STYLUS, btn1);887input_report_key(input, BTN_STYLUS2, btn2);888889input_report_abs(input, ABS_X, x);890input_report_abs(input, ABS_Y, y);891input_report_abs(input, ABS_PRESSURE, p);892input_report_abs(input, ABS_DISTANCE, d);893894if (!prox) {895wacom->id[0] = 0;896wacom->shared->stylus_in_proximity = false;897}898899input_report_key(input, wacom->tool[0], prox); /* PEN or RUBBER */900input_report_abs(input, ABS_MISC, wacom->id[0]); /* TOOL ID */901902return 1;903}904905static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)906{907if (len == WACOM_PKGLEN_BBTOUCH)908return wacom_bpt_touch(wacom);909else if (len == WACOM_PKGLEN_BBFUN)910return wacom_bpt_pen(wacom);911912return 0;913}914915void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)916{917bool sync;918919switch (wacom_wac->features.type) {920case PENPARTNER:921sync = wacom_penpartner_irq(wacom_wac);922break;923924case PL:925sync = wacom_pl_irq(wacom_wac);926break;927928case WACOM_G4:929case GRAPHIRE:930case WACOM_MO:931sync = wacom_graphire_irq(wacom_wac);932break;933934case PTU:935sync = wacom_ptu_irq(wacom_wac);936break;937938case DTU:939sync = wacom_dtu_irq(wacom_wac);940break;941942case INTUOS:943case INTUOS3S:944case INTUOS3:945case INTUOS3L:946case INTUOS4S:947case INTUOS4:948case INTUOS4L:949case CINTIQ:950case WACOM_BEE:951case WACOM_21UX2:952sync = wacom_intuos_irq(wacom_wac);953break;954955case TABLETPC:956case TABLETPC2FG:957sync = wacom_tpc_irq(wacom_wac, len);958break;959960case BAMBOO_PT:961sync = wacom_bpt_irq(wacom_wac, len);962break;963964default:965sync = false;966break;967}968969if (sync)970input_sync(wacom_wac->input);971}972973static void wacom_setup_cintiq(struct wacom_wac *wacom_wac)974{975struct input_dev *input_dev = wacom_wac->input;976977input_set_capability(input_dev, EV_MSC, MSC_SERIAL);978979__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);980__set_bit(BTN_TOOL_PEN, input_dev->keybit);981__set_bit(BTN_TOOL_BRUSH, input_dev->keybit);982__set_bit(BTN_TOOL_PENCIL, input_dev->keybit);983__set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit);984__set_bit(BTN_STYLUS, input_dev->keybit);985__set_bit(BTN_STYLUS2, input_dev->keybit);986987input_set_abs_params(input_dev, ABS_DISTANCE,9880, wacom_wac->features.distance_max, 0, 0);989input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0);990input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0);991input_set_abs_params(input_dev, ABS_TILT_Y, 0, 127, 0, 0);992}993994static void wacom_setup_intuos(struct wacom_wac *wacom_wac)995{996struct input_dev *input_dev = wacom_wac->input;997998input_set_capability(input_dev, EV_REL, REL_WHEEL);9991000wacom_setup_cintiq(wacom_wac);10011002__set_bit(BTN_LEFT, input_dev->keybit);1003__set_bit(BTN_RIGHT, input_dev->keybit);1004__set_bit(BTN_MIDDLE, input_dev->keybit);1005__set_bit(BTN_SIDE, input_dev->keybit);1006__set_bit(BTN_EXTRA, input_dev->keybit);1007__set_bit(BTN_TOOL_MOUSE, input_dev->keybit);1008__set_bit(BTN_TOOL_LENS, input_dev->keybit);10091010input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0);1011input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);1012}10131014void wacom_setup_device_quirks(struct wacom_features *features)1015{10161017/* touch device found but size is not defined. use default */1018if (features->device_type == BTN_TOOL_FINGER && !features->x_max) {1019features->x_max = 1023;1020features->y_max = 1023;1021}10221023/* these device have multiple inputs */1024if (features->type == TABLETPC || features->type == TABLETPC2FG ||1025features->type == BAMBOO_PT)1026features->quirks |= WACOM_QUIRK_MULTI_INPUT;10271028/* quirks for bamboo touch */1029if (features->type == BAMBOO_PT &&1030features->device_type == BTN_TOOL_DOUBLETAP) {1031features->x_max <<= 5;1032features->y_max <<= 5;1033features->x_fuzz <<= 5;1034features->y_fuzz <<= 5;1035features->pressure_max = 256;1036features->pressure_fuzz = 16;1037features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;1038}1039}10401041static unsigned int wacom_calculate_touch_res(unsigned int logical_max,1042unsigned int physical_max)1043{1044/* Touch physical dimensions are in 100th of mm */1045return (logical_max * 100) / physical_max;1046}10471048void wacom_setup_input_capabilities(struct input_dev *input_dev,1049struct wacom_wac *wacom_wac)1050{1051struct wacom_features *features = &wacom_wac->features;1052int i;10531054input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);10551056__set_bit(BTN_TOUCH, input_dev->keybit);10571058input_set_abs_params(input_dev, ABS_X, 0, features->x_max,1059features->x_fuzz, 0);1060input_set_abs_params(input_dev, ABS_Y, 0, features->y_max,1061features->y_fuzz, 0);1062input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,1063features->pressure_fuzz, 0);10641065if (features->device_type == BTN_TOOL_PEN) {1066/* penabled devices have fixed resolution for each model */1067input_abs_set_res(input_dev, ABS_X, features->x_resolution);1068input_abs_set_res(input_dev, ABS_Y, features->y_resolution);1069} else {1070input_abs_set_res(input_dev, ABS_X,1071wacom_calculate_touch_res(features->x_max,1072features->x_phy));1073input_abs_set_res(input_dev, ABS_Y,1074wacom_calculate_touch_res(features->y_max,1075features->y_phy));1076}10771078__set_bit(ABS_MISC, input_dev->absbit);10791080switch (wacom_wac->features.type) {1081case WACOM_MO:1082__set_bit(BTN_1, input_dev->keybit);1083__set_bit(BTN_5, input_dev->keybit);10841085input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);1086/* fall through */10871088case WACOM_G4:1089input_set_capability(input_dev, EV_MSC, MSC_SERIAL);10901091__set_bit(BTN_TOOL_FINGER, input_dev->keybit);1092__set_bit(BTN_0, input_dev->keybit);1093__set_bit(BTN_4, input_dev->keybit);1094/* fall through */10951096case GRAPHIRE:1097input_set_capability(input_dev, EV_REL, REL_WHEEL);10981099__set_bit(BTN_LEFT, input_dev->keybit);1100__set_bit(BTN_RIGHT, input_dev->keybit);1101__set_bit(BTN_MIDDLE, input_dev->keybit);11021103__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);1104__set_bit(BTN_TOOL_PEN, input_dev->keybit);1105__set_bit(BTN_TOOL_MOUSE, input_dev->keybit);1106__set_bit(BTN_STYLUS, input_dev->keybit);1107__set_bit(BTN_STYLUS2, input_dev->keybit);1108break;11091110case WACOM_21UX2:1111__set_bit(BTN_A, input_dev->keybit);1112__set_bit(BTN_B, input_dev->keybit);1113__set_bit(BTN_C, input_dev->keybit);1114__set_bit(BTN_X, input_dev->keybit);1115__set_bit(BTN_Y, input_dev->keybit);1116__set_bit(BTN_Z, input_dev->keybit);1117__set_bit(BTN_BASE, input_dev->keybit);1118__set_bit(BTN_BASE2, input_dev->keybit);1119/* fall through */11201121case WACOM_BEE:1122__set_bit(BTN_8, input_dev->keybit);1123__set_bit(BTN_9, input_dev->keybit);1124/* fall through */11251126case CINTIQ:1127for (i = 0; i < 8; i++)1128__set_bit(BTN_0 + i, input_dev->keybit);1129__set_bit(BTN_TOOL_FINGER, input_dev->keybit);11301131input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);1132input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);1133input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);1134wacom_setup_cintiq(wacom_wac);1135break;11361137case INTUOS3:1138case INTUOS3L:1139__set_bit(BTN_4, input_dev->keybit);1140__set_bit(BTN_5, input_dev->keybit);1141__set_bit(BTN_6, input_dev->keybit);1142__set_bit(BTN_7, input_dev->keybit);11431144input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);1145/* fall through */11461147case INTUOS3S:1148__set_bit(BTN_0, input_dev->keybit);1149__set_bit(BTN_1, input_dev->keybit);1150__set_bit(BTN_2, input_dev->keybit);1151__set_bit(BTN_3, input_dev->keybit);11521153__set_bit(BTN_TOOL_FINGER, input_dev->keybit);11541155input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);1156input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);1157/* fall through */11581159case INTUOS:1160wacom_setup_intuos(wacom_wac);1161break;11621163case INTUOS4:1164case INTUOS4L:1165__set_bit(BTN_7, input_dev->keybit);1166__set_bit(BTN_8, input_dev->keybit);1167/* fall through */11681169case INTUOS4S:1170for (i = 0; i < 7; i++)1171__set_bit(BTN_0 + i, input_dev->keybit);1172__set_bit(BTN_TOOL_FINGER, input_dev->keybit);11731174input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);1175wacom_setup_intuos(wacom_wac);1176break;11771178case TABLETPC2FG:1179if (features->device_type == BTN_TOOL_DOUBLETAP) {11801181input_mt_init_slots(input_dev, 2);1182input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE,11830, MT_TOOL_MAX, 0, 0);1184input_set_abs_params(input_dev, ABS_MT_POSITION_X,11850, features->x_max, 0, 0);1186input_set_abs_params(input_dev, ABS_MT_POSITION_Y,11870, features->y_max, 0, 0);1188}1189/* fall through */11901191case TABLETPC:1192__clear_bit(ABS_MISC, input_dev->absbit);11931194if (features->device_type != BTN_TOOL_PEN)1195break; /* no need to process stylus stuff */11961197/* fall through */11981199case PL:1200case PTU:1201case DTU:1202__set_bit(BTN_TOOL_PEN, input_dev->keybit);1203__set_bit(BTN_STYLUS, input_dev->keybit);1204__set_bit(BTN_STYLUS2, input_dev->keybit);1205/* fall through */12061207case PENPARTNER:1208__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);1209break;12101211case BAMBOO_PT:1212__clear_bit(ABS_MISC, input_dev->absbit);12131214if (features->device_type == BTN_TOOL_DOUBLETAP) {1215__set_bit(BTN_LEFT, input_dev->keybit);1216__set_bit(BTN_FORWARD, input_dev->keybit);1217__set_bit(BTN_BACK, input_dev->keybit);1218__set_bit(BTN_RIGHT, input_dev->keybit);12191220__set_bit(BTN_TOOL_FINGER, input_dev->keybit);1221__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);12221223input_mt_init_slots(input_dev, 2);1224input_set_abs_params(input_dev, ABS_MT_POSITION_X,12250, features->x_max,1226features->x_fuzz, 0);1227input_set_abs_params(input_dev, ABS_MT_POSITION_Y,12280, features->y_max,1229features->y_fuzz, 0);1230input_set_abs_params(input_dev, ABS_MT_PRESSURE,12310, features->pressure_max,1232features->pressure_fuzz, 0);1233} else if (features->device_type == BTN_TOOL_PEN) {1234__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);1235__set_bit(BTN_TOOL_PEN, input_dev->keybit);1236__set_bit(BTN_STYLUS, input_dev->keybit);1237__set_bit(BTN_STYLUS2, input_dev->keybit);1238}1239break;1240}1241}12421243static const struct wacom_features wacom_features_0x00 =1244{ "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255,12450, PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };1246static const struct wacom_features wacom_features_0x10 =1247{ "Wacom Graphire", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511,124863, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };1249static const struct wacom_features wacom_features_0x11 =1250{ "Wacom Graphire2 4x5", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511,125163, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };1252static const struct wacom_features wacom_features_0x12 =1253{ "Wacom Graphire2 5x7", WACOM_PKGLEN_GRAPHIRE, 13918, 10206, 511,125463, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };1255static const struct wacom_features wacom_features_0x13 =1256{ "Wacom Graphire3", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511,125763, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };1258static const struct wacom_features wacom_features_0x14 =1259{ "Wacom Graphire3 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,126063, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };1261static const struct wacom_features wacom_features_0x15 =1262{ "Wacom Graphire4 4x5", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511,126363, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };1264static const struct wacom_features wacom_features_0x16 =1265{ "Wacom Graphire4 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,126663, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };1267static const struct wacom_features wacom_features_0x17 =1268{ "Wacom BambooFun 4x5", WACOM_PKGLEN_BBFUN, 14760, 9225, 511,126963, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1270static const struct wacom_features wacom_features_0x18 =1271{ "Wacom BambooFun 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 511,127263, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1273static const struct wacom_features wacom_features_0x19 =1274{ "Wacom Bamboo1 Medium", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,127563, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };1276static const struct wacom_features wacom_features_0x60 =1277{ "Wacom Volito", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,127863, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };1279static const struct wacom_features wacom_features_0x61 =1280{ "Wacom PenStation2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 255,128163, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };1282static const struct wacom_features wacom_features_0x62 =1283{ "Wacom Volito2 4x5", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,128463, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };1285static const struct wacom_features wacom_features_0x63 =1286{ "Wacom Volito2 2x3", WACOM_PKGLEN_GRAPHIRE, 3248, 2320, 511,128763, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };1288static const struct wacom_features wacom_features_0x64 =1289{ "Wacom PenPartner2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 511,129063, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };1291static const struct wacom_features wacom_features_0x65 =1292{ "Wacom Bamboo", WACOM_PKGLEN_BBFUN, 14760, 9225, 511,129363, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1294static const struct wacom_features wacom_features_0x69 =1295{ "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,129663, GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };1297static const struct wacom_features wacom_features_0x20 =1298{ "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,129931, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1300static const struct wacom_features wacom_features_0x21 =1301{ "Wacom Intuos 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,130231, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1303static const struct wacom_features wacom_features_0x22 =1304{ "Wacom Intuos 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023,130531, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1306static const struct wacom_features wacom_features_0x23 =1307{ "Wacom Intuos 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023,130831, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1309static const struct wacom_features wacom_features_0x24 =1310{ "Wacom Intuos 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023,131131, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1312static const struct wacom_features wacom_features_0x30 =1313{ "Wacom PL400", WACOM_PKGLEN_GRAPHIRE, 5408, 4056, 255,13140, PL, WACOM_PL_RES, WACOM_PL_RES };1315static const struct wacom_features wacom_features_0x31 =1316{ "Wacom PL500", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 255,13170, PL, WACOM_PL_RES, WACOM_PL_RES };1318static const struct wacom_features wacom_features_0x32 =1319{ "Wacom PL600", WACOM_PKGLEN_GRAPHIRE, 6126, 4604, 255,13200, PL, WACOM_PL_RES, WACOM_PL_RES };1321static const struct wacom_features wacom_features_0x33 =1322{ "Wacom PL600SX", WACOM_PKGLEN_GRAPHIRE, 6260, 5016, 255,13230, PL, WACOM_PL_RES, WACOM_PL_RES };1324static const struct wacom_features wacom_features_0x34 =1325{ "Wacom PL550", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 511,13260, PL, WACOM_PL_RES, WACOM_PL_RES };1327static const struct wacom_features wacom_features_0x35 =1328{ "Wacom PL800", WACOM_PKGLEN_GRAPHIRE, 7220, 5780, 511,13290, PL, WACOM_PL_RES, WACOM_PL_RES };1330static const struct wacom_features wacom_features_0x37 =1331{ "Wacom PL700", WACOM_PKGLEN_GRAPHIRE, 6758, 5406, 511,13320, PL, WACOM_PL_RES, WACOM_PL_RES };1333static const struct wacom_features wacom_features_0x38 =1334{ "Wacom PL510", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511,13350, PL, WACOM_PL_RES, WACOM_PL_RES };1336static const struct wacom_features wacom_features_0x39 =1337{ "Wacom DTU710", WACOM_PKGLEN_GRAPHIRE, 34080, 27660, 511,13380, PL, WACOM_PL_RES, WACOM_PL_RES };1339static const struct wacom_features wacom_features_0xC4 =1340{ "Wacom DTF521", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511,13410, PL, WACOM_PL_RES, WACOM_PL_RES };1342static const struct wacom_features wacom_features_0xC0 =1343{ "Wacom DTF720", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511,13440, PL, WACOM_PL_RES, WACOM_PL_RES };1345static const struct wacom_features wacom_features_0xC2 =1346{ "Wacom DTF720a", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511,13470, PL, WACOM_PL_RES, WACOM_PL_RES };1348static const struct wacom_features wacom_features_0x03 =1349{ "Wacom Cintiq Partner", WACOM_PKGLEN_GRAPHIRE, 20480, 15360, 511,13500, PTU, WACOM_PL_RES, WACOM_PL_RES };1351static const struct wacom_features wacom_features_0x41 =1352{ "Wacom Intuos2 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,135331, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1354static const struct wacom_features wacom_features_0x42 =1355{ "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,135631, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1357static const struct wacom_features wacom_features_0x43 =1358{ "Wacom Intuos2 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023,135931, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1360static const struct wacom_features wacom_features_0x44 =1361{ "Wacom Intuos2 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023,136231, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1363static const struct wacom_features wacom_features_0x45 =1364{ "Wacom Intuos2 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023,136531, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1366static const struct wacom_features wacom_features_0xB0 =1367{ "Wacom Intuos3 4x5", WACOM_PKGLEN_INTUOS, 25400, 20320, 1023,136863, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1369static const struct wacom_features wacom_features_0xB1 =1370{ "Wacom Intuos3 6x8", WACOM_PKGLEN_INTUOS, 40640, 30480, 1023,137163, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1372static const struct wacom_features wacom_features_0xB2 =1373{ "Wacom Intuos3 9x12", WACOM_PKGLEN_INTUOS, 60960, 45720, 1023,137463, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1375static const struct wacom_features wacom_features_0xB3 =1376{ "Wacom Intuos3 12x12", WACOM_PKGLEN_INTUOS, 60960, 60960, 1023,137763, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1378static const struct wacom_features wacom_features_0xB4 =1379{ "Wacom Intuos3 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 1023,138063, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1381static const struct wacom_features wacom_features_0xB5 =1382{ "Wacom Intuos3 6x11", WACOM_PKGLEN_INTUOS, 54204, 31750, 1023,138363, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1384static const struct wacom_features wacom_features_0xB7 =1385{ "Wacom Intuos3 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 1023,138663, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1387static const struct wacom_features wacom_features_0xB8 =1388{ "Wacom Intuos4 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,138963, INTUOS4S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1390static const struct wacom_features wacom_features_0xB9 =1391{ "Wacom Intuos4 6x9", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047,139263, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1393static const struct wacom_features wacom_features_0xBA =1394{ "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047,139563, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1396static const struct wacom_features wacom_features_0xBB =1397{ "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047,139863, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1399static const struct wacom_features wacom_features_0xBC =1400{ "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047,140163, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1402static const struct wacom_features wacom_features_0x3F =1403{ "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,140463, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1405static const struct wacom_features wacom_features_0xC5 =1406{ "Wacom Cintiq 20WSX", WACOM_PKGLEN_INTUOS, 86680, 54180, 1023,140763, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1408static const struct wacom_features wacom_features_0xC6 =1409{ "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023,141063, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1411static const struct wacom_features wacom_features_0xC7 =1412{ "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511,14130, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1414static const struct wacom_features wacom_features_0xCE =1415{ "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511,14160, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1417static const struct wacom_features wacom_features_0xF0 =1418{ "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511,14190, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1420static const struct wacom_features wacom_features_0xCC =1421{ "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047,142263, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };1423static const struct wacom_features wacom_features_0x90 =1424{ "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,14250, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1426static const struct wacom_features wacom_features_0x93 =1427{ "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,14280, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1429static const struct wacom_features wacom_features_0x9A =1430{ "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,14310, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1432static const struct wacom_features wacom_features_0x9F =1433{ "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,14340, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1435static const struct wacom_features wacom_features_0xE2 =1436{ "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,14370, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1438static const struct wacom_features wacom_features_0xE3 =1439{ "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,14400, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1441static const struct wacom_features wacom_features_0xE6 =1442{ "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255,14430, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1444static const struct wacom_features wacom_features_0x47 =1445{ "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,144631, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1447static const struct wacom_features wacom_features_0xD0 =1448{ "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,144963, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1450static const struct wacom_features wacom_features_0xD1 =1451{ "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,145263, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1453static const struct wacom_features wacom_features_0xD2 =1454{ "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,145563, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1456static const struct wacom_features wacom_features_0xD3 =1457{ "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,145863, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1459static const struct wacom_features wacom_features_0xD4 =1460{ "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255,146163, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1462static const struct wacom_features wacom_features_0xD6 =1463{ "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,146463, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1465static const struct wacom_features wacom_features_0xD7 =1466{ "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,146763, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1468static const struct wacom_features wacom_features_0xD8 =1469{ "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,147063, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1471static const struct wacom_features wacom_features_0xDA =1472{ "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,147363, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1474static struct wacom_features wacom_features_0xDB =1475{ "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,147663, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };1477static const struct wacom_features wacom_features_0x6004 =1478{ "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,14790, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };14801481#define USB_DEVICE_WACOM(prod) \1482USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \1483.driver_info = (kernel_ulong_t)&wacom_features_##prod14841485#define USB_DEVICE_LENOVO(prod) \1486USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \1487.driver_info = (kernel_ulong_t)&wacom_features_##prod14881489const struct usb_device_id wacom_ids[] = {1490{ USB_DEVICE_WACOM(0x00) },1491{ USB_DEVICE_WACOM(0x10) },1492{ USB_DEVICE_WACOM(0x11) },1493{ USB_DEVICE_WACOM(0x12) },1494{ USB_DEVICE_WACOM(0x13) },1495{ USB_DEVICE_WACOM(0x14) },1496{ USB_DEVICE_WACOM(0x15) },1497{ USB_DEVICE_WACOM(0x16) },1498{ USB_DEVICE_WACOM(0x17) },1499{ USB_DEVICE_WACOM(0x18) },1500{ USB_DEVICE_WACOM(0x19) },1501{ USB_DEVICE_WACOM(0x60) },1502{ USB_DEVICE_WACOM(0x61) },1503{ USB_DEVICE_WACOM(0x62) },1504{ USB_DEVICE_WACOM(0x63) },1505{ USB_DEVICE_WACOM(0x64) },1506{ USB_DEVICE_WACOM(0x65) },1507{ USB_DEVICE_WACOM(0x69) },1508{ USB_DEVICE_WACOM(0x20) },1509{ USB_DEVICE_WACOM(0x21) },1510{ USB_DEVICE_WACOM(0x22) },1511{ USB_DEVICE_WACOM(0x23) },1512{ USB_DEVICE_WACOM(0x24) },1513{ USB_DEVICE_WACOM(0x30) },1514{ USB_DEVICE_WACOM(0x31) },1515{ USB_DEVICE_WACOM(0x32) },1516{ USB_DEVICE_WACOM(0x33) },1517{ USB_DEVICE_WACOM(0x34) },1518{ USB_DEVICE_WACOM(0x35) },1519{ USB_DEVICE_WACOM(0x37) },1520{ USB_DEVICE_WACOM(0x38) },1521{ USB_DEVICE_WACOM(0x39) },1522{ USB_DEVICE_WACOM(0xC4) },1523{ USB_DEVICE_WACOM(0xC0) },1524{ USB_DEVICE_WACOM(0xC2) },1525{ USB_DEVICE_WACOM(0x03) },1526{ USB_DEVICE_WACOM(0x41) },1527{ USB_DEVICE_WACOM(0x42) },1528{ USB_DEVICE_WACOM(0x43) },1529{ USB_DEVICE_WACOM(0x44) },1530{ USB_DEVICE_WACOM(0x45) },1531{ USB_DEVICE_WACOM(0xB0) },1532{ USB_DEVICE_WACOM(0xB1) },1533{ USB_DEVICE_WACOM(0xB2) },1534{ USB_DEVICE_WACOM(0xB3) },1535{ USB_DEVICE_WACOM(0xB4) },1536{ USB_DEVICE_WACOM(0xB5) },1537{ USB_DEVICE_WACOM(0xB7) },1538{ USB_DEVICE_WACOM(0xB8) },1539{ USB_DEVICE_WACOM(0xB9) },1540{ USB_DEVICE_WACOM(0xBA) },1541{ USB_DEVICE_WACOM(0xBB) },1542{ USB_DEVICE_WACOM(0xBC) },1543{ USB_DEVICE_WACOM(0x3F) },1544{ USB_DEVICE_WACOM(0xC5) },1545{ USB_DEVICE_WACOM(0xC6) },1546{ USB_DEVICE_WACOM(0xC7) },1547{ USB_DEVICE_WACOM(0xCE) },1548{ USB_DEVICE_WACOM(0xD0) },1549{ USB_DEVICE_WACOM(0xD1) },1550{ USB_DEVICE_WACOM(0xD2) },1551{ USB_DEVICE_WACOM(0xD3) },1552{ USB_DEVICE_WACOM(0xD4) },1553{ USB_DEVICE_WACOM(0xD6) },1554{ USB_DEVICE_WACOM(0xD7) },1555{ USB_DEVICE_WACOM(0xD8) },1556{ USB_DEVICE_WACOM(0xDA) },1557{ USB_DEVICE_WACOM(0xDB) },1558{ USB_DEVICE_WACOM(0xF0) },1559{ USB_DEVICE_WACOM(0xCC) },1560{ USB_DEVICE_WACOM(0x90) },1561{ USB_DEVICE_WACOM(0x93) },1562{ USB_DEVICE_WACOM(0x9A) },1563{ USB_DEVICE_WACOM(0x9F) },1564{ USB_DEVICE_WACOM(0xE2) },1565{ USB_DEVICE_WACOM(0xE3) },1566{ USB_DEVICE_WACOM(0xE6) },1567{ USB_DEVICE_WACOM(0x47) },1568{ USB_DEVICE_LENOVO(0x6004) },1569{ }1570};1571MODULE_DEVICE_TABLE(usb, wacom_ids);157215731574