wacom_wac.c 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847
  1. /*
  2. * drivers/input/tablet/wacom_wac.c
  3. *
  4. * USB Wacom tablet support - Wacom specific code
  5. *
  6. */
  7. /*
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #include "wacom_wac.h"
  14. #include "wacom.h"
  15. #include <linux/input/mt.h>
  16. #include <linux/hid.h>
  17. /* resolution for penabled devices */
  18. #define WACOM_PL_RES 20
  19. #define WACOM_PENPRTN_RES 40
  20. #define WACOM_VOLITO_RES 50
  21. #define WACOM_GRAPHIRE_RES 80
  22. #define WACOM_INTUOS_RES 100
  23. #define WACOM_INTUOS3_RES 200
  24. static int wacom_penpartner_irq(struct wacom_wac *wacom)
  25. {
  26. unsigned char *data = wacom->data;
  27. struct input_dev *input = wacom->input;
  28. switch (data[0]) {
  29. case 1:
  30. if (data[5] & 0x80) {
  31. wacom->tool[0] = (data[5] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
  32. wacom->id[0] = (data[5] & 0x20) ? ERASER_DEVICE_ID : STYLUS_DEVICE_ID;
  33. input_report_key(input, wacom->tool[0], 1);
  34. input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
  35. input_report_abs(input, ABS_X, get_unaligned_le16(&data[1]));
  36. input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3]));
  37. input_report_abs(input, ABS_PRESSURE, (signed char)data[6] + 127);
  38. input_report_key(input, BTN_TOUCH, ((signed char)data[6] > -127));
  39. input_report_key(input, BTN_STYLUS, (data[5] & 0x40));
  40. } else {
  41. input_report_key(input, wacom->tool[0], 0);
  42. input_report_abs(input, ABS_MISC, 0); /* report tool id */
  43. input_report_abs(input, ABS_PRESSURE, -1);
  44. input_report_key(input, BTN_TOUCH, 0);
  45. }
  46. break;
  47. case 2:
  48. input_report_key(input, BTN_TOOL_PEN, 1);
  49. input_report_abs(input, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */
  50. input_report_abs(input, ABS_X, get_unaligned_le16(&data[1]));
  51. input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3]));
  52. input_report_abs(input, ABS_PRESSURE, (signed char)data[6] + 127);
  53. input_report_key(input, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20));
  54. input_report_key(input, BTN_STYLUS, (data[5] & 0x40));
  55. break;
  56. default:
  57. printk(KERN_INFO "wacom_penpartner_irq: received unknown report #%d\n", data[0]);
  58. return 0;
  59. }
  60. return 1;
  61. }
  62. static int wacom_pl_irq(struct wacom_wac *wacom)
  63. {
  64. struct wacom_features *features = &wacom->features;
  65. unsigned char *data = wacom->data;
  66. struct input_dev *input = wacom->input;
  67. int prox, pressure;
  68. if (data[0] != WACOM_REPORT_PENABLED) {
  69. dbg("wacom_pl_irq: received unknown report #%d", data[0]);
  70. return 0;
  71. }
  72. prox = data[1] & 0x40;
  73. if (prox) {
  74. wacom->id[0] = ERASER_DEVICE_ID;
  75. pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1));
  76. if (features->pressure_max > 255)
  77. pressure = (pressure << 1) | ((data[4] >> 6) & 1);
  78. pressure += (features->pressure_max + 1) / 2;
  79. /*
  80. * if going from out of proximity into proximity select between the eraser
  81. * and the pen based on the state of the stylus2 button, choose eraser if
  82. * pressed else choose pen. if not a proximity change from out to in, send
  83. * an out of proximity for previous tool then a in for new tool.
  84. */
  85. if (!wacom->tool[0]) {
  86. /* Eraser bit set for DTF */
  87. if (data[1] & 0x10)
  88. wacom->tool[1] = BTN_TOOL_RUBBER;
  89. else
  90. /* Going into proximity select tool */
  91. wacom->tool[1] = (data[4] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
  92. } else {
  93. /* was entered with stylus2 pressed */
  94. if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20)) {
  95. /* report out proximity for previous tool */
  96. input_report_key(input, wacom->tool[1], 0);
  97. input_sync(input);
  98. wacom->tool[1] = BTN_TOOL_PEN;
  99. return 0;
  100. }
  101. }
  102. if (wacom->tool[1] != BTN_TOOL_RUBBER) {
  103. /* Unknown tool selected default to pen tool */
  104. wacom->tool[1] = BTN_TOOL_PEN;
  105. wacom->id[0] = STYLUS_DEVICE_ID;
  106. }
  107. input_report_key(input, wacom->tool[1], prox); /* report in proximity for tool */
  108. input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
  109. input_report_abs(input, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14));
  110. input_report_abs(input, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14));
  111. input_report_abs(input, ABS_PRESSURE, pressure);
  112. input_report_key(input, BTN_TOUCH, data[4] & 0x08);
  113. input_report_key(input, BTN_STYLUS, data[4] & 0x10);
  114. /* Only allow the stylus2 button to be reported for the pen tool. */
  115. input_report_key(input, BTN_STYLUS2, (wacom->tool[1] == BTN_TOOL_PEN) && (data[4] & 0x20));
  116. } else {
  117. /* report proximity-out of a (valid) tool */
  118. if (wacom->tool[1] != BTN_TOOL_RUBBER) {
  119. /* Unknown tool selected default to pen tool */
  120. wacom->tool[1] = BTN_TOOL_PEN;
  121. }
  122. input_report_key(input, wacom->tool[1], prox);
  123. }
  124. wacom->tool[0] = prox; /* Save proximity state */
  125. return 1;
  126. }
  127. static int wacom_ptu_irq(struct wacom_wac *wacom)
  128. {
  129. unsigned char *data = wacom->data;
  130. struct input_dev *input = wacom->input;
  131. if (data[0] != WACOM_REPORT_PENABLED) {
  132. printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]);
  133. return 0;
  134. }
  135. if (data[1] & 0x04) {
  136. input_report_key(input, BTN_TOOL_RUBBER, data[1] & 0x20);
  137. input_report_key(input, BTN_TOUCH, data[1] & 0x08);
  138. wacom->id[0] = ERASER_DEVICE_ID;
  139. } else {
  140. input_report_key(input, BTN_TOOL_PEN, data[1] & 0x20);
  141. input_report_key(input, BTN_TOUCH, data[1] & 0x01);
  142. wacom->id[0] = STYLUS_DEVICE_ID;
  143. }
  144. input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
  145. input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
  146. input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
  147. input_report_abs(input, ABS_PRESSURE, le16_to_cpup((__le16 *)&data[6]));
  148. input_report_key(input, BTN_STYLUS, data[1] & 0x02);
  149. input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
  150. return 1;
  151. }
  152. static int wacom_dtu_irq(struct wacom_wac *wacom)
  153. {
  154. struct wacom_features *features = &wacom->features;
  155. char *data = wacom->data;
  156. struct input_dev *input = wacom->input;
  157. int prox = data[1] & 0x20, pressure;
  158. dbg("wacom_dtu_irq: received report #%d", data[0]);
  159. if (prox) {
  160. /* Going into proximity select tool */
  161. wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
  162. if (wacom->tool[0] == BTN_TOOL_PEN)
  163. wacom->id[0] = STYLUS_DEVICE_ID;
  164. else
  165. wacom->id[0] = ERASER_DEVICE_ID;
  166. }
  167. input_report_key(input, BTN_STYLUS, data[1] & 0x02);
  168. input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
  169. input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
  170. input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
  171. pressure = ((data[7] & 0x01) << 8) | data[6];
  172. if (pressure < 0)
  173. pressure = features->pressure_max + pressure + 1;
  174. input_report_abs(input, ABS_PRESSURE, pressure);
  175. input_report_key(input, BTN_TOUCH, data[1] & 0x05);
  176. if (!prox) /* out-prox */
  177. wacom->id[0] = 0;
  178. input_report_key(input, wacom->tool[0], prox);
  179. input_report_abs(input, ABS_MISC, wacom->id[0]);
  180. return 1;
  181. }
  182. static int wacom_graphire_irq(struct wacom_wac *wacom)
  183. {
  184. struct wacom_features *features = &wacom->features;
  185. unsigned char *data = wacom->data;
  186. struct input_dev *input = wacom->input;
  187. int prox;
  188. int rw = 0;
  189. int retval = 0;
  190. if (data[0] != WACOM_REPORT_PENABLED) {
  191. dbg("wacom_graphire_irq: received unknown report #%d", data[0]);
  192. goto exit;
  193. }
  194. prox = data[1] & 0x80;
  195. if (prox || wacom->id[0]) {
  196. if (prox) {
  197. switch ((data[1] >> 5) & 3) {
  198. case 0: /* Pen */
  199. wacom->tool[0] = BTN_TOOL_PEN;
  200. wacom->id[0] = STYLUS_DEVICE_ID;
  201. break;
  202. case 1: /* Rubber */
  203. wacom->tool[0] = BTN_TOOL_RUBBER;
  204. wacom->id[0] = ERASER_DEVICE_ID;
  205. break;
  206. case 2: /* Mouse with wheel */
  207. input_report_key(input, BTN_MIDDLE, data[1] & 0x04);
  208. /* fall through */
  209. case 3: /* Mouse without wheel */
  210. wacom->tool[0] = BTN_TOOL_MOUSE;
  211. wacom->id[0] = CURSOR_DEVICE_ID;
  212. break;
  213. }
  214. }
  215. input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
  216. input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
  217. if (wacom->tool[0] != BTN_TOOL_MOUSE) {
  218. input_report_abs(input, ABS_PRESSURE, data[6] | ((data[7] & 0x03) << 8));
  219. input_report_key(input, BTN_TOUCH, data[1] & 0x01);
  220. input_report_key(input, BTN_STYLUS, data[1] & 0x02);
  221. input_report_key(input, BTN_STYLUS2, data[1] & 0x04);
  222. } else {
  223. input_report_key(input, BTN_LEFT, data[1] & 0x01);
  224. input_report_key(input, BTN_RIGHT, data[1] & 0x02);
  225. if (features->type == WACOM_G4 ||
  226. features->type == WACOM_MO) {
  227. input_report_abs(input, ABS_DISTANCE, data[6] & 0x3f);
  228. rw = (data[7] & 0x04) - (data[7] & 0x03);
  229. } else {
  230. input_report_abs(input, ABS_DISTANCE, data[7] & 0x3f);
  231. rw = -(signed char)data[6];
  232. }
  233. input_report_rel(input, REL_WHEEL, rw);
  234. }
  235. if (!prox)
  236. wacom->id[0] = 0;
  237. input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
  238. input_report_key(input, wacom->tool[0], prox);
  239. input_event(input, EV_MSC, MSC_SERIAL, 1);
  240. input_sync(input); /* sync last event */
  241. }
  242. /* send pad data */
  243. switch (features->type) {
  244. case WACOM_G4:
  245. prox = data[7] & 0xf8;
  246. if (prox || wacom->id[1]) {
  247. wacom->id[1] = PAD_DEVICE_ID;
  248. input_report_key(input, BTN_BACK, (data[7] & 0x40));
  249. input_report_key(input, BTN_FORWARD, (data[7] & 0x80));
  250. rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
  251. input_report_rel(input, REL_WHEEL, rw);
  252. if (!prox)
  253. wacom->id[1] = 0;
  254. input_report_abs(input, ABS_MISC, wacom->id[1]);
  255. input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
  256. retval = 1;
  257. }
  258. break;
  259. case WACOM_MO:
  260. prox = (data[7] & 0xf8) || data[8];
  261. if (prox || wacom->id[1]) {
  262. wacom->id[1] = PAD_DEVICE_ID;
  263. input_report_key(input, BTN_BACK, (data[7] & 0x08));
  264. input_report_key(input, BTN_LEFT, (data[7] & 0x20));
  265. input_report_key(input, BTN_FORWARD, (data[7] & 0x10));
  266. input_report_key(input, BTN_RIGHT, (data[7] & 0x40));
  267. input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f));
  268. if (!prox)
  269. wacom->id[1] = 0;
  270. input_report_abs(input, ABS_MISC, wacom->id[1]);
  271. input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
  272. retval = 1;
  273. }
  274. break;
  275. }
  276. exit:
  277. return retval;
  278. }
  279. static int wacom_intuos_inout(struct wacom_wac *wacom)
  280. {
  281. struct wacom_features *features = &wacom->features;
  282. unsigned char *data = wacom->data;
  283. struct input_dev *input = wacom->input;
  284. int idx = 0;
  285. /* tool number */
  286. if (features->type == INTUOS)
  287. idx = data[1] & 0x01;
  288. /* Enter report */
  289. if ((data[1] & 0xfc) == 0xc0) {
  290. /* serial number of the tool */
  291. wacom->serial[idx] = ((data[3] & 0x0f) << 28) +
  292. (data[4] << 20) + (data[5] << 12) +
  293. (data[6] << 4) + (data[7] >> 4);
  294. wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) |
  295. ((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12);
  296. switch (wacom->id[idx] & 0xfffff) {
  297. case 0x812: /* Inking pen */
  298. case 0x801: /* Intuos3 Inking pen */
  299. case 0x20802: /* Intuos4 Inking Pen */
  300. case 0x012:
  301. wacom->tool[idx] = BTN_TOOL_PENCIL;
  302. break;
  303. case 0x822: /* Pen */
  304. case 0x842:
  305. case 0x852:
  306. case 0x823: /* Intuos3 Grip Pen */
  307. case 0x813: /* Intuos3 Classic Pen */
  308. case 0x885: /* Intuos3 Marker Pen */
  309. case 0x802: /* Intuos4 General Pen */
  310. case 0x804: /* Intuos4 Marker Pen */
  311. case 0x40802: /* Intuos4 Classic Pen */
  312. case 0x022:
  313. wacom->tool[idx] = BTN_TOOL_PEN;
  314. break;
  315. case 0x832: /* Stroke pen */
  316. case 0x032:
  317. wacom->tool[idx] = BTN_TOOL_BRUSH;
  318. break;
  319. case 0x007: /* Mouse 4D and 2D */
  320. case 0x09c:
  321. case 0x094:
  322. case 0x017: /* Intuos3 2D Mouse */
  323. case 0x806: /* Intuos4 Mouse */
  324. wacom->tool[idx] = BTN_TOOL_MOUSE;
  325. break;
  326. case 0x096: /* Lens cursor */
  327. case 0x097: /* Intuos3 Lens cursor */
  328. case 0x006: /* Intuos4 Lens cursor */
  329. wacom->tool[idx] = BTN_TOOL_LENS;
  330. break;
  331. case 0x82a: /* Eraser */
  332. case 0x85a:
  333. case 0x91a:
  334. case 0xd1a:
  335. case 0x0fa:
  336. case 0x82b: /* Intuos3 Grip Pen Eraser */
  337. case 0x81b: /* Intuos3 Classic Pen Eraser */
  338. case 0x91b: /* Intuos3 Airbrush Eraser */
  339. case 0x80c: /* Intuos4 Marker Pen Eraser */
  340. case 0x80a: /* Intuos4 General Pen Eraser */
  341. case 0x4080a: /* Intuos4 Classic Pen Eraser */
  342. case 0x90a: /* Intuos4 Airbrush Eraser */
  343. wacom->tool[idx] = BTN_TOOL_RUBBER;
  344. break;
  345. case 0xd12:
  346. case 0x912:
  347. case 0x112:
  348. case 0x913: /* Intuos3 Airbrush */
  349. case 0x902: /* Intuos4 Airbrush */
  350. wacom->tool[idx] = BTN_TOOL_AIRBRUSH;
  351. break;
  352. default: /* Unknown tool */
  353. wacom->tool[idx] = BTN_TOOL_PEN;
  354. break;
  355. }
  356. return 1;
  357. }
  358. /* older I4 styli don't work with new Cintiqs */
  359. if (!((wacom->id[idx] >> 20) & 0x01) &&
  360. (features->type == WACOM_21UX2))
  361. return 1;
  362. /* Exit report */
  363. if ((data[1] & 0xfe) == 0x80) {
  364. /*
  365. * Reset all states otherwise we lose the initial states
  366. * when in-prox next time
  367. */
  368. input_report_abs(input, ABS_X, 0);
  369. input_report_abs(input, ABS_Y, 0);
  370. input_report_abs(input, ABS_DISTANCE, 0);
  371. input_report_abs(input, ABS_TILT_X, 0);
  372. input_report_abs(input, ABS_TILT_Y, 0);
  373. if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
  374. input_report_key(input, BTN_LEFT, 0);
  375. input_report_key(input, BTN_MIDDLE, 0);
  376. input_report_key(input, BTN_RIGHT, 0);
  377. input_report_key(input, BTN_SIDE, 0);
  378. input_report_key(input, BTN_EXTRA, 0);
  379. input_report_abs(input, ABS_THROTTLE, 0);
  380. input_report_abs(input, ABS_RZ, 0);
  381. } else {
  382. input_report_abs(input, ABS_PRESSURE, 0);
  383. input_report_key(input, BTN_STYLUS, 0);
  384. input_report_key(input, BTN_STYLUS2, 0);
  385. input_report_key(input, BTN_TOUCH, 0);
  386. input_report_abs(input, ABS_WHEEL, 0);
  387. if (features->type >= INTUOS3S)
  388. input_report_abs(input, ABS_Z, 0);
  389. }
  390. input_report_key(input, wacom->tool[idx], 0);
  391. input_report_abs(input, ABS_MISC, 0); /* reset tool id */
  392. input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
  393. wacom->id[idx] = 0;
  394. return 2;
  395. }
  396. return 0;
  397. }
  398. static void wacom_intuos_general(struct wacom_wac *wacom)
  399. {
  400. struct wacom_features *features = &wacom->features;
  401. unsigned char *data = wacom->data;
  402. struct input_dev *input = wacom->input;
  403. unsigned int t;
  404. /* general pen packet */
  405. if ((data[1] & 0xb8) == 0xa0) {
  406. t = (data[6] << 2) | ((data[7] >> 6) & 3);
  407. if ((features->type >= INTUOS4S && features->type <= INTUOS4L) ||
  408. features->type == WACOM_21UX2 || features->type == WACOM_24HD) {
  409. t = (t << 1) | (data[1] & 1);
  410. }
  411. input_report_abs(input, ABS_PRESSURE, t);
  412. input_report_abs(input, ABS_TILT_X,
  413. ((data[7] << 1) & 0x7e) | (data[8] >> 7));
  414. input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f);
  415. input_report_key(input, BTN_STYLUS, data[1] & 2);
  416. input_report_key(input, BTN_STYLUS2, data[1] & 4);
  417. input_report_key(input, BTN_TOUCH, t > 10);
  418. }
  419. /* airbrush second packet */
  420. if ((data[1] & 0xbc) == 0xb4) {
  421. input_report_abs(input, ABS_WHEEL,
  422. (data[6] << 2) | ((data[7] >> 6) & 3));
  423. input_report_abs(input, ABS_TILT_X,
  424. ((data[7] << 1) & 0x7e) | (data[8] >> 7));
  425. input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f);
  426. }
  427. }
  428. static int wacom_intuos_irq(struct wacom_wac *wacom)
  429. {
  430. struct wacom_features *features = &wacom->features;
  431. unsigned char *data = wacom->data;
  432. struct input_dev *input = wacom->input;
  433. unsigned int t;
  434. int idx = 0, result;
  435. if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD
  436. && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) {
  437. dbg("wacom_intuos_irq: received unknown report #%d", data[0]);
  438. return 0;
  439. }
  440. /* tool number */
  441. if (features->type == INTUOS)
  442. idx = data[1] & 0x01;
  443. /* pad packets. Works as a second tool and is always in prox */
  444. if (data[0] == WACOM_REPORT_INTUOSPAD) {
  445. if (features->type >= INTUOS4S && features->type <= INTUOS4L) {
  446. input_report_key(input, BTN_0, (data[2] & 0x01));
  447. input_report_key(input, BTN_1, (data[3] & 0x01));
  448. input_report_key(input, BTN_2, (data[3] & 0x02));
  449. input_report_key(input, BTN_3, (data[3] & 0x04));
  450. input_report_key(input, BTN_4, (data[3] & 0x08));
  451. input_report_key(input, BTN_5, (data[3] & 0x10));
  452. input_report_key(input, BTN_6, (data[3] & 0x20));
  453. if (data[1] & 0x80) {
  454. input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f));
  455. } else {
  456. /* Out of proximity, clear wheel value. */
  457. input_report_abs(input, ABS_WHEEL, 0);
  458. }
  459. if (features->type != INTUOS4S) {
  460. input_report_key(input, BTN_7, (data[3] & 0x40));
  461. input_report_key(input, BTN_8, (data[3] & 0x80));
  462. }
  463. if (data[1] | (data[2] & 0x01) | data[3]) {
  464. input_report_key(input, wacom->tool[1], 1);
  465. input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
  466. } else {
  467. input_report_key(input, wacom->tool[1], 0);
  468. input_report_abs(input, ABS_MISC, 0);
  469. }
  470. } else if (features->type == WACOM_24HD) {
  471. input_report_key(input, BTN_0, (data[6] & 0x01));
  472. input_report_key(input, BTN_1, (data[6] & 0x02));
  473. input_report_key(input, BTN_2, (data[6] & 0x04));
  474. input_report_key(input, BTN_3, (data[6] & 0x08));
  475. input_report_key(input, BTN_4, (data[6] & 0x10));
  476. input_report_key(input, BTN_5, (data[6] & 0x20));
  477. input_report_key(input, BTN_6, (data[6] & 0x40));
  478. input_report_key(input, BTN_7, (data[6] & 0x80));
  479. input_report_key(input, BTN_8, (data[8] & 0x01));
  480. input_report_key(input, BTN_9, (data[8] & 0x02));
  481. input_report_key(input, BTN_A, (data[8] & 0x04));
  482. input_report_key(input, BTN_B, (data[8] & 0x08));
  483. input_report_key(input, BTN_C, (data[8] & 0x10));
  484. input_report_key(input, BTN_X, (data[8] & 0x20));
  485. input_report_key(input, BTN_Y, (data[8] & 0x40));
  486. input_report_key(input, BTN_Z, (data[8] & 0x80));
  487. /*
  488. * Three "buttons" are available on the 24HD which are
  489. * physically implemented as a touchstrip. Each button
  490. * is approximately 3 bits wide with a 2 bit spacing.
  491. * The raw touchstrip bits are stored at:
  492. * ((data[3] & 0x1f) << 8) | data[4])
  493. */
  494. input_report_key(input, KEY_PROG1, data[4] & 0x07);
  495. input_report_key(input, KEY_PROG2, data[4] & 0xE0);
  496. input_report_key(input, KEY_PROG3, data[3] & 0x1C);
  497. if (data[1] & 0x80) {
  498. input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f));
  499. } else {
  500. /* Out of proximity, clear wheel value. */
  501. input_report_abs(input, ABS_WHEEL, 0);
  502. }
  503. if (data[2] & 0x80) {
  504. input_report_abs(input, ABS_THROTTLE, (data[2] & 0x7f));
  505. } else {
  506. /* Out of proximity, clear second wheel value. */
  507. input_report_abs(input, ABS_THROTTLE, 0);
  508. }
  509. if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) {
  510. input_report_key(input, wacom->tool[1], 1);
  511. input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
  512. } else {
  513. input_report_key(input, wacom->tool[1], 0);
  514. input_report_abs(input, ABS_MISC, 0);
  515. }
  516. } else {
  517. if (features->type == WACOM_21UX2) {
  518. input_report_key(input, BTN_0, (data[5] & 0x01));
  519. input_report_key(input, BTN_1, (data[6] & 0x01));
  520. input_report_key(input, BTN_2, (data[6] & 0x02));
  521. input_report_key(input, BTN_3, (data[6] & 0x04));
  522. input_report_key(input, BTN_4, (data[6] & 0x08));
  523. input_report_key(input, BTN_5, (data[6] & 0x10));
  524. input_report_key(input, BTN_6, (data[6] & 0x20));
  525. input_report_key(input, BTN_7, (data[6] & 0x40));
  526. input_report_key(input, BTN_8, (data[6] & 0x80));
  527. input_report_key(input, BTN_9, (data[7] & 0x01));
  528. input_report_key(input, BTN_A, (data[8] & 0x01));
  529. input_report_key(input, BTN_B, (data[8] & 0x02));
  530. input_report_key(input, BTN_C, (data[8] & 0x04));
  531. input_report_key(input, BTN_X, (data[8] & 0x08));
  532. input_report_key(input, BTN_Y, (data[8] & 0x10));
  533. input_report_key(input, BTN_Z, (data[8] & 0x20));
  534. input_report_key(input, BTN_BASE, (data[8] & 0x40));
  535. input_report_key(input, BTN_BASE2, (data[8] & 0x80));
  536. } else {
  537. input_report_key(input, BTN_0, (data[5] & 0x01));
  538. input_report_key(input, BTN_1, (data[5] & 0x02));
  539. input_report_key(input, BTN_2, (data[5] & 0x04));
  540. input_report_key(input, BTN_3, (data[5] & 0x08));
  541. input_report_key(input, BTN_4, (data[6] & 0x01));
  542. input_report_key(input, BTN_5, (data[6] & 0x02));
  543. input_report_key(input, BTN_6, (data[6] & 0x04));
  544. input_report_key(input, BTN_7, (data[6] & 0x08));
  545. input_report_key(input, BTN_8, (data[5] & 0x10));
  546. input_report_key(input, BTN_9, (data[6] & 0x10));
  547. }
  548. input_report_abs(input, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
  549. input_report_abs(input, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
  550. if ((data[5] & 0x1f) | data[6] | (data[1] & 0x1f) |
  551. data[2] | (data[3] & 0x1f) | data[4] | data[8] |
  552. (data[7] & 0x01)) {
  553. input_report_key(input, wacom->tool[1], 1);
  554. input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
  555. } else {
  556. input_report_key(input, wacom->tool[1], 0);
  557. input_report_abs(input, ABS_MISC, 0);
  558. }
  559. }
  560. input_event(input, EV_MSC, MSC_SERIAL, 0xffffffff);
  561. return 1;
  562. }
  563. /* process in/out prox events */
  564. result = wacom_intuos_inout(wacom);
  565. if (result)
  566. return result - 1;
  567. /* don't proceed if we don't know the ID */
  568. if (!wacom->id[idx])
  569. return 0;
  570. /* Only large Intuos support Lense Cursor */
  571. if (wacom->tool[idx] == BTN_TOOL_LENS &&
  572. (features->type == INTUOS3 ||
  573. features->type == INTUOS3S ||
  574. features->type == INTUOS4 ||
  575. features->type == INTUOS4S)) {
  576. return 0;
  577. }
  578. /* Cintiq doesn't send data when RDY bit isn't set */
  579. if (features->type == CINTIQ && !(data[1] & 0x40))
  580. return 0;
  581. if (features->type >= INTUOS3S) {
  582. input_report_abs(input, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1));
  583. input_report_abs(input, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1));
  584. input_report_abs(input, ABS_DISTANCE, ((data[9] >> 2) & 0x3f));
  585. } else {
  586. input_report_abs(input, ABS_X, be16_to_cpup((__be16 *)&data[2]));
  587. input_report_abs(input, ABS_Y, be16_to_cpup((__be16 *)&data[4]));
  588. input_report_abs(input, ABS_DISTANCE, ((data[9] >> 3) & 0x1f));
  589. }
  590. /* process general packets */
  591. wacom_intuos_general(wacom);
  592. /* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */
  593. if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0 || (data[1] & 0xbc) == 0xac) {
  594. if (data[1] & 0x02) {
  595. /* Rotation packet */
  596. if (features->type >= INTUOS3S) {
  597. /* I3 marker pen rotation */
  598. t = (data[6] << 3) | ((data[7] >> 5) & 7);
  599. t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) :
  600. ((t-1) / 2 + 450)) : (450 - t / 2) ;
  601. input_report_abs(input, ABS_Z, t);
  602. } else {
  603. /* 4D mouse rotation packet */
  604. t = (data[6] << 3) | ((data[7] >> 5) & 7);
  605. input_report_abs(input, ABS_RZ, (data[7] & 0x20) ?
  606. ((t - 1) / 2) : -t / 2);
  607. }
  608. } else if (!(data[1] & 0x10) && features->type < INTUOS3S) {
  609. /* 4D mouse packet */
  610. input_report_key(input, BTN_LEFT, data[8] & 0x01);
  611. input_report_key(input, BTN_MIDDLE, data[8] & 0x02);
  612. input_report_key(input, BTN_RIGHT, data[8] & 0x04);
  613. input_report_key(input, BTN_SIDE, data[8] & 0x20);
  614. input_report_key(input, BTN_EXTRA, data[8] & 0x10);
  615. t = (data[6] << 2) | ((data[7] >> 6) & 3);
  616. input_report_abs(input, ABS_THROTTLE, (data[8] & 0x08) ? -t : t);
  617. } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
  618. /* I4 mouse */
  619. if (features->type >= INTUOS4S && features->type <= INTUOS4L) {
  620. input_report_key(input, BTN_LEFT, data[6] & 0x01);
  621. input_report_key(input, BTN_MIDDLE, data[6] & 0x02);
  622. input_report_key(input, BTN_RIGHT, data[6] & 0x04);
  623. input_report_rel(input, REL_WHEEL, ((data[7] & 0x80) >> 7)
  624. - ((data[7] & 0x40) >> 6));
  625. input_report_key(input, BTN_SIDE, data[6] & 0x08);
  626. input_report_key(input, BTN_EXTRA, data[6] & 0x10);
  627. input_report_abs(input, ABS_TILT_X,
  628. ((data[7] << 1) & 0x7e) | (data[8] >> 7));
  629. input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f);
  630. } else {
  631. /* 2D mouse packet */
  632. input_report_key(input, BTN_LEFT, data[8] & 0x04);
  633. input_report_key(input, BTN_MIDDLE, data[8] & 0x08);
  634. input_report_key(input, BTN_RIGHT, data[8] & 0x10);
  635. input_report_rel(input, REL_WHEEL, (data[8] & 0x01)
  636. - ((data[8] & 0x02) >> 1));
  637. /* I3 2D mouse side buttons */
  638. if (features->type >= INTUOS3S && features->type <= INTUOS3L) {
  639. input_report_key(input, BTN_SIDE, data[8] & 0x40);
  640. input_report_key(input, BTN_EXTRA, data[8] & 0x20);
  641. }
  642. }
  643. } else if ((features->type < INTUOS3S || features->type == INTUOS3L ||
  644. features->type == INTUOS4L) &&
  645. wacom->tool[idx] == BTN_TOOL_LENS) {
  646. /* Lens cursor packets */
  647. input_report_key(input, BTN_LEFT, data[8] & 0x01);
  648. input_report_key(input, BTN_MIDDLE, data[8] & 0x02);
  649. input_report_key(input, BTN_RIGHT, data[8] & 0x04);
  650. input_report_key(input, BTN_SIDE, data[8] & 0x10);
  651. input_report_key(input, BTN_EXTRA, data[8] & 0x08);
  652. }
  653. }
  654. input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */
  655. input_report_key(input, wacom->tool[idx], 1);
  656. input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
  657. return 1;
  658. }
  659. static int wacom_tpc_mt_touch(struct wacom_wac *wacom)
  660. {
  661. struct input_dev *input = wacom->input;
  662. unsigned char *data = wacom->data;
  663. int contact_with_no_pen_down_count = 0;
  664. int i;
  665. for (i = 0; i < 2; i++) {
  666. int p = data[1] & (1 << i);
  667. bool touch = p && !wacom->shared->stylus_in_proximity;
  668. input_mt_slot(input, i);
  669. input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
  670. if (touch) {
  671. int x = le16_to_cpup((__le16 *)&data[i * 2 + 2]) & 0x7fff;
  672. int y = le16_to_cpup((__le16 *)&data[i * 2 + 6]) & 0x7fff;
  673. input_report_abs(input, ABS_MT_POSITION_X, x);
  674. input_report_abs(input, ABS_MT_POSITION_Y, y);
  675. contact_with_no_pen_down_count++;
  676. }
  677. }
  678. /* keep touch state for pen event */
  679. wacom->shared->touch_down = (contact_with_no_pen_down_count > 0);
  680. input_mt_report_pointer_emulation(input, true);
  681. return 1;
  682. }
  683. static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len)
  684. {
  685. char *data = wacom->data;
  686. struct input_dev *input = wacom->input;
  687. bool prox;
  688. int x = 0, y = 0;
  689. if (!wacom->shared->stylus_in_proximity) {
  690. if (len == WACOM_PKGLEN_TPC1FG) {
  691. prox = data[0] & 0x01;
  692. x = get_unaligned_le16(&data[1]);
  693. y = get_unaligned_le16(&data[3]);
  694. } else { /* with capacity */
  695. prox = data[1] & 0x01;
  696. x = le16_to_cpup((__le16 *)&data[2]);
  697. y = le16_to_cpup((__le16 *)&data[4]);
  698. }
  699. } else
  700. /* force touch out when pen is in prox */
  701. prox = 0;
  702. if (prox) {
  703. input_report_abs(input, ABS_X, x);
  704. input_report_abs(input, ABS_Y, y);
  705. }
  706. input_report_key(input, BTN_TOUCH, prox);
  707. /* keep touch state for pen events */
  708. wacom->shared->touch_down = prox;
  709. return 1;
  710. }
  711. static int wacom_tpc_pen(struct wacom_wac *wacom)
  712. {
  713. struct wacom_features *features = &wacom->features;
  714. char *data = wacom->data;
  715. struct input_dev *input = wacom->input;
  716. int pressure;
  717. bool prox = data[1] & 0x20;
  718. if (!wacom->shared->stylus_in_proximity) /* first in prox */
  719. /* Going into proximity select tool */
  720. wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
  721. /* keep pen state for touch events */
  722. wacom->shared->stylus_in_proximity = prox;
  723. /* send pen events only when touch is up or forced out */
  724. if (!wacom->shared->touch_down) {
  725. input_report_key(input, BTN_STYLUS, data[1] & 0x02);
  726. input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
  727. input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
  728. input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
  729. pressure = ((data[7] & 0x01) << 8) | data[6];
  730. if (pressure < 0)
  731. pressure = features->pressure_max + pressure + 1;
  732. input_report_abs(input, ABS_PRESSURE, pressure);
  733. input_report_key(input, BTN_TOUCH, data[1] & 0x05);
  734. input_report_key(input, wacom->tool[0], prox);
  735. return 1;
  736. }
  737. return 0;
  738. }
  739. static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
  740. {
  741. char *data = wacom->data;
  742. dbg("wacom_tpc_irq: received report #%d", data[0]);
  743. switch (len) {
  744. case WACOM_PKGLEN_TPC1FG:
  745. return wacom_tpc_single_touch(wacom, len);
  746. case WACOM_PKGLEN_TPC2FG:
  747. return wacom_tpc_mt_touch(wacom);
  748. default:
  749. switch (data[0]) {
  750. case WACOM_REPORT_TPC1FG:
  751. case WACOM_REPORT_TPCHID:
  752. case WACOM_REPORT_TPCST:
  753. return wacom_tpc_single_touch(wacom, len);
  754. case WACOM_REPORT_PENABLED:
  755. return wacom_tpc_pen(wacom);
  756. }
  757. }
  758. return 0;
  759. }
  760. static int wacom_bpt_touch(struct wacom_wac *wacom)
  761. {
  762. struct wacom_features *features = &wacom->features;
  763. struct input_dev *input = wacom->input;
  764. unsigned char *data = wacom->data;
  765. int i;
  766. if (data[0] != 0x02)
  767. return 0;
  768. for (i = 0; i < 2; i++) {
  769. int offset = (data[1] & 0x80) ? (8 * i) : (9 * i);
  770. bool touch = data[offset + 3] & 0x80;
  771. /*
  772. * Touch events need to be disabled while stylus is
  773. * in proximity because user's hand is resting on touchpad
  774. * and sending unwanted events. User expects tablet buttons
  775. * to continue working though.
  776. */
  777. touch = touch && !wacom->shared->stylus_in_proximity;
  778. input_mt_slot(input, i);
  779. input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
  780. if (touch) {
  781. int x = get_unaligned_be16(&data[offset + 3]) & 0x7ff;
  782. int y = get_unaligned_be16(&data[offset + 5]) & 0x7ff;
  783. if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
  784. x <<= 5;
  785. y <<= 5;
  786. }
  787. input_report_abs(input, ABS_MT_POSITION_X, x);
  788. input_report_abs(input, ABS_MT_POSITION_Y, y);
  789. }
  790. }
  791. input_mt_report_pointer_emulation(input, true);
  792. input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
  793. input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
  794. input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
  795. input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
  796. input_sync(input);
  797. return 0;
  798. }
  799. static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
  800. {
  801. struct input_dev *input = wacom->input;
  802. int slot_id = data[0] - 2; /* data[0] is between 2 and 17 */
  803. bool touch = data[1] & 0x80;
  804. touch = touch && !wacom->shared->stylus_in_proximity;
  805. input_mt_slot(input, slot_id);
  806. input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
  807. if (touch) {
  808. int x = (data[2] << 4) | (data[4] >> 4);
  809. int y = (data[3] << 4) | (data[4] & 0x0f);
  810. int w = data[6];
  811. input_report_abs(input, ABS_MT_POSITION_X, x);
  812. input_report_abs(input, ABS_MT_POSITION_Y, y);
  813. input_report_abs(input, ABS_MT_TOUCH_MAJOR, w);
  814. }
  815. }
  816. static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data)
  817. {
  818. struct input_dev *input = wacom->input;
  819. input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
  820. input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
  821. input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
  822. input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
  823. }
  824. static int wacom_bpt3_touch(struct wacom_wac *wacom)
  825. {
  826. struct input_dev *input = wacom->input;
  827. unsigned char *data = wacom->data;
  828. int count = data[1] & 0x07;
  829. int i;
  830. if (data[0] != 0x02)
  831. return 0;
  832. /* data has up to 7 fixed sized 8-byte messages starting at data[2] */
  833. for (i = 0; i < count; i++) {
  834. int offset = (8 * i) + 2;
  835. int msg_id = data[offset];
  836. if (msg_id >= 2 && msg_id <= 17)
  837. wacom_bpt3_touch_msg(wacom, data + offset);
  838. else if (msg_id == 128)
  839. wacom_bpt3_button_msg(wacom, data + offset);
  840. }
  841. input_mt_report_pointer_emulation(input, true);
  842. input_sync(input);
  843. return 0;
  844. }
  845. static int wacom_bpt_pen(struct wacom_wac *wacom)
  846. {
  847. struct input_dev *input = wacom->input;
  848. unsigned char *data = wacom->data;
  849. int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
  850. if (data[0] != 0x02)
  851. return 0;
  852. prox = (data[1] & 0x20) == 0x20;
  853. /*
  854. * All reports shared between PEN and RUBBER tool must be
  855. * forced to a known starting value (zero) when transitioning to
  856. * out-of-prox.
  857. *
  858. * If not reset then, to userspace, it will look like lost events
  859. * if new tool comes in-prox with same values as previous tool sent.
  860. *
  861. * Hardware does report zero in most out-of-prox cases but not all.
  862. */
  863. if (prox) {
  864. if (!wacom->shared->stylus_in_proximity) {
  865. if (data[1] & 0x08) {
  866. wacom->tool[0] = BTN_TOOL_RUBBER;
  867. wacom->id[0] = ERASER_DEVICE_ID;
  868. } else {
  869. wacom->tool[0] = BTN_TOOL_PEN;
  870. wacom->id[0] = STYLUS_DEVICE_ID;
  871. }
  872. wacom->shared->stylus_in_proximity = true;
  873. }
  874. x = le16_to_cpup((__le16 *)&data[2]);
  875. y = le16_to_cpup((__le16 *)&data[4]);
  876. p = le16_to_cpup((__le16 *)&data[6]);
  877. /*
  878. * Convert distance from out prox to distance from tablet.
  879. * distance will be greater than distance_max once
  880. * touching and applying pressure; do not report negative
  881. * distance.
  882. */
  883. if (data[8] <= wacom->features.distance_max)
  884. d = wacom->features.distance_max - data[8];
  885. pen = data[1] & 0x01;
  886. btn1 = data[1] & 0x02;
  887. btn2 = data[1] & 0x04;
  888. }
  889. input_report_key(input, BTN_TOUCH, pen);
  890. input_report_key(input, BTN_STYLUS, btn1);
  891. input_report_key(input, BTN_STYLUS2, btn2);
  892. input_report_abs(input, ABS_X, x);
  893. input_report_abs(input, ABS_Y, y);
  894. input_report_abs(input, ABS_PRESSURE, p);
  895. input_report_abs(input, ABS_DISTANCE, d);
  896. if (!prox) {
  897. wacom->id[0] = 0;
  898. wacom->shared->stylus_in_proximity = false;
  899. }
  900. input_report_key(input, wacom->tool[0], prox); /* PEN or RUBBER */
  901. input_report_abs(input, ABS_MISC, wacom->id[0]); /* TOOL ID */
  902. return 1;
  903. }
  904. static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
  905. {
  906. if (len == WACOM_PKGLEN_BBTOUCH)
  907. return wacom_bpt_touch(wacom);
  908. else if (len == WACOM_PKGLEN_BBTOUCH3)
  909. return wacom_bpt3_touch(wacom);
  910. else if (len == WACOM_PKGLEN_BBFUN || len == WACOM_PKGLEN_BBPEN)
  911. return wacom_bpt_pen(wacom);
  912. return 0;
  913. }
  914. static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
  915. {
  916. unsigned char *data = wacom->data;
  917. int connected;
  918. if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80)
  919. return 0;
  920. connected = data[1] & 0x01;
  921. if (connected) {
  922. int pid, battery;
  923. pid = get_unaligned_be16(&data[6]);
  924. battery = data[5] & 0x3f;
  925. if (wacom->pid != pid) {
  926. wacom->pid = pid;
  927. wacom_schedule_work(wacom);
  928. }
  929. wacom->battery_capacity = battery;
  930. } else if (wacom->pid != 0) {
  931. /* disconnected while previously connected */
  932. wacom->pid = 0;
  933. wacom_schedule_work(wacom);
  934. wacom->battery_capacity = 0;
  935. }
  936. return 0;
  937. }
  938. void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
  939. {
  940. bool sync;
  941. switch (wacom_wac->features.type) {
  942. case PENPARTNER:
  943. sync = wacom_penpartner_irq(wacom_wac);
  944. break;
  945. case PL:
  946. sync = wacom_pl_irq(wacom_wac);
  947. break;
  948. case WACOM_G4:
  949. case GRAPHIRE:
  950. case WACOM_MO:
  951. sync = wacom_graphire_irq(wacom_wac);
  952. break;
  953. case PTU:
  954. sync = wacom_ptu_irq(wacom_wac);
  955. break;
  956. case DTU:
  957. sync = wacom_dtu_irq(wacom_wac);
  958. break;
  959. case INTUOS:
  960. case INTUOS3S:
  961. case INTUOS3:
  962. case INTUOS3L:
  963. case INTUOS4S:
  964. case INTUOS4:
  965. case INTUOS4L:
  966. case CINTIQ:
  967. case WACOM_BEE:
  968. case WACOM_21UX2:
  969. case WACOM_24HD:
  970. sync = wacom_intuos_irq(wacom_wac);
  971. break;
  972. case TABLETPC:
  973. case TABLETPC2FG:
  974. sync = wacom_tpc_irq(wacom_wac, len);
  975. break;
  976. case BAMBOO_PT:
  977. sync = wacom_bpt_irq(wacom_wac, len);
  978. break;
  979. case WIRELESS:
  980. sync = wacom_wireless_irq(wacom_wac, len);
  981. break;
  982. default:
  983. sync = false;
  984. break;
  985. }
  986. if (sync)
  987. input_sync(wacom_wac->input);
  988. }
  989. static void wacom_setup_cintiq(struct wacom_wac *wacom_wac)
  990. {
  991. struct input_dev *input_dev = wacom_wac->input;
  992. input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
  993. __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
  994. __set_bit(BTN_TOOL_PEN, input_dev->keybit);
  995. __set_bit(BTN_TOOL_BRUSH, input_dev->keybit);
  996. __set_bit(BTN_TOOL_PENCIL, input_dev->keybit);
  997. __set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit);
  998. __set_bit(BTN_STYLUS, input_dev->keybit);
  999. __set_bit(BTN_STYLUS2, input_dev->keybit);
  1000. input_set_abs_params(input_dev, ABS_DISTANCE,
  1001. 0, wacom_wac->features.distance_max, 0, 0);
  1002. input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0);
  1003. input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0);
  1004. input_set_abs_params(input_dev, ABS_TILT_Y, 0, 127, 0, 0);
  1005. }
  1006. static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
  1007. {
  1008. struct input_dev *input_dev = wacom_wac->input;
  1009. input_set_capability(input_dev, EV_REL, REL_WHEEL);
  1010. wacom_setup_cintiq(wacom_wac);
  1011. __set_bit(BTN_LEFT, input_dev->keybit);
  1012. __set_bit(BTN_RIGHT, input_dev->keybit);
  1013. __set_bit(BTN_MIDDLE, input_dev->keybit);
  1014. __set_bit(BTN_SIDE, input_dev->keybit);
  1015. __set_bit(BTN_EXTRA, input_dev->keybit);
  1016. __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
  1017. __set_bit(BTN_TOOL_LENS, input_dev->keybit);
  1018. input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0);
  1019. input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);
  1020. }
  1021. void wacom_setup_device_quirks(struct wacom_features *features)
  1022. {
  1023. /* touch device found but size is not defined. use default */
  1024. if (features->device_type == BTN_TOOL_FINGER && !features->x_max) {
  1025. features->x_max = 1023;
  1026. features->y_max = 1023;
  1027. }
  1028. /* these device have multiple inputs */
  1029. if (features->type == TABLETPC || features->type == TABLETPC2FG ||
  1030. features->type == BAMBOO_PT || features->type == WIRELESS)
  1031. features->quirks |= WACOM_QUIRK_MULTI_INPUT;
  1032. /* quirk for bamboo touch with 2 low res touches */
  1033. if (features->type == BAMBOO_PT &&
  1034. features->pktlen == WACOM_PKGLEN_BBTOUCH) {
  1035. features->x_max <<= 5;
  1036. features->y_max <<= 5;
  1037. features->x_fuzz <<= 5;
  1038. features->y_fuzz <<= 5;
  1039. features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
  1040. }
  1041. if (features->type == WIRELESS) {
  1042. /* monitor never has input and pen/touch have delayed create */
  1043. features->quirks |= WACOM_QUIRK_NO_INPUT;
  1044. /* must be monitor interface if no device_type set */
  1045. if (!features->device_type)
  1046. features->quirks |= WACOM_QUIRK_MONITOR;
  1047. }
  1048. }
  1049. static unsigned int wacom_calculate_touch_res(unsigned int logical_max,
  1050. unsigned int physical_max)
  1051. {
  1052. /* Touch physical dimensions are in 100th of mm */
  1053. return (logical_max * 100) / physical_max;
  1054. }
  1055. void wacom_setup_input_capabilities(struct input_dev *input_dev,
  1056. struct wacom_wac *wacom_wac)
  1057. {
  1058. struct wacom_features *features = &wacom_wac->features;
  1059. int i;
  1060. input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
  1061. __set_bit(BTN_TOUCH, input_dev->keybit);
  1062. input_set_abs_params(input_dev, ABS_X, 0, features->x_max,
  1063. features->x_fuzz, 0);
  1064. input_set_abs_params(input_dev, ABS_Y, 0, features->y_max,
  1065. features->y_fuzz, 0);
  1066. if (features->device_type == BTN_TOOL_PEN) {
  1067. input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
  1068. features->pressure_fuzz, 0);
  1069. /* penabled devices have fixed resolution for each model */
  1070. input_abs_set_res(input_dev, ABS_X, features->x_resolution);
  1071. input_abs_set_res(input_dev, ABS_Y, features->y_resolution);
  1072. } else {
  1073. input_abs_set_res(input_dev, ABS_X,
  1074. wacom_calculate_touch_res(features->x_max,
  1075. features->x_phy));
  1076. input_abs_set_res(input_dev, ABS_Y,
  1077. wacom_calculate_touch_res(features->y_max,
  1078. features->y_phy));
  1079. }
  1080. __set_bit(ABS_MISC, input_dev->absbit);
  1081. switch (wacom_wac->features.type) {
  1082. case WACOM_MO:
  1083. input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
  1084. /* fall through */
  1085. case WACOM_G4:
  1086. input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
  1087. __set_bit(BTN_BACK, input_dev->keybit);
  1088. __set_bit(BTN_FORWARD, input_dev->keybit);
  1089. /* fall through */
  1090. case GRAPHIRE:
  1091. input_set_capability(input_dev, EV_REL, REL_WHEEL);
  1092. __set_bit(BTN_LEFT, input_dev->keybit);
  1093. __set_bit(BTN_RIGHT, input_dev->keybit);
  1094. __set_bit(BTN_MIDDLE, input_dev->keybit);
  1095. __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
  1096. __set_bit(BTN_TOOL_PEN, input_dev->keybit);
  1097. __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
  1098. __set_bit(BTN_STYLUS, input_dev->keybit);
  1099. __set_bit(BTN_STYLUS2, input_dev->keybit);
  1100. __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
  1101. break;
  1102. case WACOM_24HD:
  1103. __set_bit(BTN_A, input_dev->keybit);
  1104. __set_bit(BTN_B, input_dev->keybit);
  1105. __set_bit(BTN_C, input_dev->keybit);
  1106. __set_bit(BTN_X, input_dev->keybit);
  1107. __set_bit(BTN_Y, input_dev->keybit);
  1108. __set_bit(BTN_Z, input_dev->keybit);
  1109. for (i = 0; i < 10; i++)
  1110. __set_bit(BTN_0 + i, input_dev->keybit);
  1111. __set_bit(KEY_PROG1, input_dev->keybit);
  1112. __set_bit(KEY_PROG2, input_dev->keybit);
  1113. __set_bit(KEY_PROG3, input_dev->keybit);
  1114. input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
  1115. input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
  1116. wacom_setup_cintiq(wacom_wac);
  1117. break;
  1118. case WACOM_21UX2:
  1119. __set_bit(BTN_A, input_dev->keybit);
  1120. __set_bit(BTN_B, input_dev->keybit);
  1121. __set_bit(BTN_C, input_dev->keybit);
  1122. __set_bit(BTN_X, input_dev->keybit);
  1123. __set_bit(BTN_Y, input_dev->keybit);
  1124. __set_bit(BTN_Z, input_dev->keybit);
  1125. __set_bit(BTN_BASE, input_dev->keybit);
  1126. __set_bit(BTN_BASE2, input_dev->keybit);
  1127. /* fall through */
  1128. case WACOM_BEE:
  1129. __set_bit(BTN_8, input_dev->keybit);
  1130. __set_bit(BTN_9, input_dev->keybit);
  1131. /* fall through */
  1132. case CINTIQ:
  1133. for (i = 0; i < 8; i++)
  1134. __set_bit(BTN_0 + i, input_dev->keybit);
  1135. input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
  1136. input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
  1137. input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
  1138. __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
  1139. wacom_setup_cintiq(wacom_wac);
  1140. break;
  1141. case INTUOS3:
  1142. case INTUOS3L:
  1143. __set_bit(BTN_4, input_dev->keybit);
  1144. __set_bit(BTN_5, input_dev->keybit);
  1145. __set_bit(BTN_6, input_dev->keybit);
  1146. __set_bit(BTN_7, input_dev->keybit);
  1147. input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
  1148. /* fall through */
  1149. case INTUOS3S:
  1150. __set_bit(BTN_0, input_dev->keybit);
  1151. __set_bit(BTN_1, input_dev->keybit);
  1152. __set_bit(BTN_2, input_dev->keybit);
  1153. __set_bit(BTN_3, input_dev->keybit);
  1154. input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
  1155. input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
  1156. /* fall through */
  1157. case INTUOS:
  1158. __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
  1159. wacom_setup_intuos(wacom_wac);
  1160. break;
  1161. case INTUOS4:
  1162. case INTUOS4L:
  1163. __set_bit(BTN_7, input_dev->keybit);
  1164. __set_bit(BTN_8, input_dev->keybit);
  1165. /* fall through */
  1166. case INTUOS4S:
  1167. for (i = 0; i < 7; i++)
  1168. __set_bit(BTN_0 + i, input_dev->keybit);
  1169. input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
  1170. wacom_setup_intuos(wacom_wac);
  1171. __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
  1172. break;
  1173. case TABLETPC2FG:
  1174. if (features->device_type == BTN_TOOL_FINGER) {
  1175. input_mt_init_slots(input_dev, 2);
  1176. input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE,
  1177. 0, MT_TOOL_MAX, 0, 0);
  1178. input_set_abs_params(input_dev, ABS_MT_POSITION_X,
  1179. 0, features->x_max, 0, 0);
  1180. input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
  1181. 0, features->y_max, 0, 0);
  1182. }
  1183. /* fall through */
  1184. case TABLETPC:
  1185. __clear_bit(ABS_MISC, input_dev->absbit);
  1186. __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
  1187. if (features->device_type != BTN_TOOL_PEN)
  1188. break; /* no need to process stylus stuff */
  1189. /* fall through */
  1190. case PL:
  1191. case DTU:
  1192. __set_bit(BTN_TOOL_PEN, input_dev->keybit);
  1193. __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
  1194. __set_bit(BTN_STYLUS, input_dev->keybit);
  1195. __set_bit(BTN_STYLUS2, input_dev->keybit);
  1196. __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
  1197. break;
  1198. case PTU:
  1199. __set_bit(BTN_STYLUS2, input_dev->keybit);
  1200. /* fall through */
  1201. case PENPARTNER:
  1202. __set_bit(BTN_TOOL_PEN, input_dev->keybit);
  1203. __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
  1204. __set_bit(BTN_STYLUS, input_dev->keybit);
  1205. __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
  1206. break;
  1207. case BAMBOO_PT:
  1208. __clear_bit(ABS_MISC, input_dev->absbit);
  1209. __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
  1210. if (features->device_type == BTN_TOOL_FINGER) {
  1211. __set_bit(BTN_LEFT, input_dev->keybit);
  1212. __set_bit(BTN_FORWARD, input_dev->keybit);
  1213. __set_bit(BTN_BACK, input_dev->keybit);
  1214. __set_bit(BTN_RIGHT, input_dev->keybit);
  1215. __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
  1216. __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
  1217. if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
  1218. __set_bit(BTN_TOOL_TRIPLETAP,
  1219. input_dev->keybit);
  1220. __set_bit(BTN_TOOL_QUADTAP,
  1221. input_dev->keybit);
  1222. input_mt_init_slots(input_dev, 16);
  1223. input_set_abs_params(input_dev,
  1224. ABS_MT_TOUCH_MAJOR,
  1225. 0, 255, 0, 0);
  1226. } else {
  1227. input_mt_init_slots(input_dev, 2);
  1228. }
  1229. input_set_abs_params(input_dev, ABS_MT_POSITION_X,
  1230. 0, features->x_max,
  1231. features->x_fuzz, 0);
  1232. input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
  1233. 0, features->y_max,
  1234. features->y_fuzz, 0);
  1235. } else if (features->device_type == BTN_TOOL_PEN) {
  1236. __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
  1237. __set_bit(BTN_TOOL_PEN, input_dev->keybit);
  1238. __set_bit(BTN_STYLUS, input_dev->keybit);
  1239. __set_bit(BTN_STYLUS2, input_dev->keybit);
  1240. input_set_abs_params(input_dev, ABS_DISTANCE, 0,
  1241. features->distance_max,
  1242. 0, 0);
  1243. }
  1244. break;
  1245. }
  1246. }
  1247. static const struct wacom_features wacom_features_0x00 =
  1248. { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255,
  1249. 0, PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
  1250. static const struct wacom_features wacom_features_0x10 =
  1251. { "Wacom Graphire", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511,
  1252. 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  1253. static const struct wacom_features wacom_features_0x11 =
  1254. { "Wacom Graphire2 4x5", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511,
  1255. 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  1256. static const struct wacom_features wacom_features_0x12 =
  1257. { "Wacom Graphire2 5x7", WACOM_PKGLEN_GRAPHIRE, 13918, 10206, 511,
  1258. 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  1259. static const struct wacom_features wacom_features_0x13 =
  1260. { "Wacom Graphire3", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511,
  1261. 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  1262. static const struct wacom_features wacom_features_0x14 =
  1263. { "Wacom Graphire3 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
  1264. 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  1265. static const struct wacom_features wacom_features_0x15 =
  1266. { "Wacom Graphire4 4x5", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511,
  1267. 63, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  1268. static const struct wacom_features wacom_features_0x16 =
  1269. { "Wacom Graphire4 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
  1270. 63, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  1271. static const struct wacom_features wacom_features_0x17 =
  1272. { "Wacom BambooFun 4x5", WACOM_PKGLEN_BBFUN, 14760, 9225, 511,
  1273. 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1274. static const struct wacom_features wacom_features_0x18 =
  1275. { "Wacom BambooFun 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 511,
  1276. 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1277. static const struct wacom_features wacom_features_0x19 =
  1278. { "Wacom Bamboo1 Medium", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
  1279. 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  1280. static const struct wacom_features wacom_features_0x60 =
  1281. { "Wacom Volito", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
  1282. 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  1283. static const struct wacom_features wacom_features_0x61 =
  1284. { "Wacom PenStation2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 255,
  1285. 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  1286. static const struct wacom_features wacom_features_0x62 =
  1287. { "Wacom Volito2 4x5", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
  1288. 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  1289. static const struct wacom_features wacom_features_0x63 =
  1290. { "Wacom Volito2 2x3", WACOM_PKGLEN_GRAPHIRE, 3248, 2320, 511,
  1291. 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  1292. static const struct wacom_features wacom_features_0x64 =
  1293. { "Wacom PenPartner2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 511,
  1294. 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  1295. static const struct wacom_features wacom_features_0x65 =
  1296. { "Wacom Bamboo", WACOM_PKGLEN_BBFUN, 14760, 9225, 511,
  1297. 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1298. static const struct wacom_features wacom_features_0x69 =
  1299. { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
  1300. 63, GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
  1301. static const struct wacom_features wacom_features_0x6A =
  1302. { "Wacom Bamboo1 4x6", WACOM_PKGLEN_GRAPHIRE, 14760, 9225, 1023,
  1303. 63, GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1304. static const struct wacom_features wacom_features_0x6B =
  1305. { "Wacom Bamboo1 5x8", WACOM_PKGLEN_GRAPHIRE, 21648, 13530, 1023,
  1306. 63, GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1307. static const struct wacom_features wacom_features_0x20 =
  1308. { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,
  1309. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1310. static const struct wacom_features wacom_features_0x21 =
  1311. { "Wacom Intuos 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
  1312. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1313. static const struct wacom_features wacom_features_0x22 =
  1314. { "Wacom Intuos 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023,
  1315. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1316. static const struct wacom_features wacom_features_0x23 =
  1317. { "Wacom Intuos 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023,
  1318. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1319. static const struct wacom_features wacom_features_0x24 =
  1320. { "Wacom Intuos 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023,
  1321. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1322. static const struct wacom_features wacom_features_0x30 =
  1323. { "Wacom PL400", WACOM_PKGLEN_GRAPHIRE, 5408, 4056, 255,
  1324. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1325. static const struct wacom_features wacom_features_0x31 =
  1326. { "Wacom PL500", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 255,
  1327. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1328. static const struct wacom_features wacom_features_0x32 =
  1329. { "Wacom PL600", WACOM_PKGLEN_GRAPHIRE, 6126, 4604, 255,
  1330. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1331. static const struct wacom_features wacom_features_0x33 =
  1332. { "Wacom PL600SX", WACOM_PKGLEN_GRAPHIRE, 6260, 5016, 255,
  1333. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1334. static const struct wacom_features wacom_features_0x34 =
  1335. { "Wacom PL550", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 511,
  1336. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1337. static const struct wacom_features wacom_features_0x35 =
  1338. { "Wacom PL800", WACOM_PKGLEN_GRAPHIRE, 7220, 5780, 511,
  1339. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1340. static const struct wacom_features wacom_features_0x37 =
  1341. { "Wacom PL700", WACOM_PKGLEN_GRAPHIRE, 6758, 5406, 511,
  1342. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1343. static const struct wacom_features wacom_features_0x38 =
  1344. { "Wacom PL510", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511,
  1345. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1346. static const struct wacom_features wacom_features_0x39 =
  1347. { "Wacom DTU710", WACOM_PKGLEN_GRAPHIRE, 34080, 27660, 511,
  1348. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1349. static const struct wacom_features wacom_features_0xC4 =
  1350. { "Wacom DTF521", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511,
  1351. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1352. static const struct wacom_features wacom_features_0xC0 =
  1353. { "Wacom DTF720", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511,
  1354. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1355. static const struct wacom_features wacom_features_0xC2 =
  1356. { "Wacom DTF720a", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511,
  1357. 0, PL, WACOM_PL_RES, WACOM_PL_RES };
  1358. static const struct wacom_features wacom_features_0x03 =
  1359. { "Wacom Cintiq Partner", WACOM_PKGLEN_GRAPHIRE, 20480, 15360, 511,
  1360. 0, PTU, WACOM_PL_RES, WACOM_PL_RES };
  1361. static const struct wacom_features wacom_features_0x41 =
  1362. { "Wacom Intuos2 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,
  1363. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1364. static const struct wacom_features wacom_features_0x42 =
  1365. { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
  1366. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1367. static const struct wacom_features wacom_features_0x43 =
  1368. { "Wacom Intuos2 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023,
  1369. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1370. static const struct wacom_features wacom_features_0x44 =
  1371. { "Wacom Intuos2 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023,
  1372. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1373. static const struct wacom_features wacom_features_0x45 =
  1374. { "Wacom Intuos2 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023,
  1375. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1376. static const struct wacom_features wacom_features_0xB0 =
  1377. { "Wacom Intuos3 4x5", WACOM_PKGLEN_INTUOS, 25400, 20320, 1023,
  1378. 63, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1379. static const struct wacom_features wacom_features_0xB1 =
  1380. { "Wacom Intuos3 6x8", WACOM_PKGLEN_INTUOS, 40640, 30480, 1023,
  1381. 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1382. static const struct wacom_features wacom_features_0xB2 =
  1383. { "Wacom Intuos3 9x12", WACOM_PKGLEN_INTUOS, 60960, 45720, 1023,
  1384. 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1385. static const struct wacom_features wacom_features_0xB3 =
  1386. { "Wacom Intuos3 12x12", WACOM_PKGLEN_INTUOS, 60960, 60960, 1023,
  1387. 63, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1388. static const struct wacom_features wacom_features_0xB4 =
  1389. { "Wacom Intuos3 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 1023,
  1390. 63, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1391. static const struct wacom_features wacom_features_0xB5 =
  1392. { "Wacom Intuos3 6x11", WACOM_PKGLEN_INTUOS, 54204, 31750, 1023,
  1393. 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1394. static const struct wacom_features wacom_features_0xB7 =
  1395. { "Wacom Intuos3 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 1023,
  1396. 63, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1397. static const struct wacom_features wacom_features_0xB8 =
  1398. { "Wacom Intuos4 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
  1399. 63, INTUOS4S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1400. static const struct wacom_features wacom_features_0xB9 =
  1401. { "Wacom Intuos4 6x9", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047,
  1402. 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1403. static const struct wacom_features wacom_features_0xBA =
  1404. { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047,
  1405. 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1406. static const struct wacom_features wacom_features_0xBB =
  1407. { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047,
  1408. 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1409. static const struct wacom_features wacom_features_0xBC =
  1410. { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047,
  1411. 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1412. static const struct wacom_features wacom_features_0xF4 =
  1413. { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047,
  1414. 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1415. static const struct wacom_features wacom_features_0x3F =
  1416. { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,
  1417. 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1418. static const struct wacom_features wacom_features_0xC5 =
  1419. { "Wacom Cintiq 20WSX", WACOM_PKGLEN_INTUOS, 86680, 54180, 1023,
  1420. 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1421. static const struct wacom_features wacom_features_0xC6 =
  1422. { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023,
  1423. 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1424. static const struct wacom_features wacom_features_0xC7 =
  1425. { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511,
  1426. 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1427. static const struct wacom_features wacom_features_0xCE =
  1428. { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511,
  1429. 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1430. static const struct wacom_features wacom_features_0xF0 =
  1431. { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511,
  1432. 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1433. static const struct wacom_features wacom_features_0xCC =
  1434. { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047,
  1435. 63, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  1436. static const struct wacom_features wacom_features_0x90 =
  1437. { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
  1438. 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1439. static const struct wacom_features wacom_features_0x93 =
  1440. { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
  1441. 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1442. static const struct wacom_features wacom_features_0x97 =
  1443. { "Wacom ISDv4 97", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 511,
  1444. 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1445. static const struct wacom_features wacom_features_0x9A =
  1446. { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
  1447. 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1448. static const struct wacom_features wacom_features_0x9F =
  1449. { "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
  1450. 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1451. static const struct wacom_features wacom_features_0xE2 =
  1452. { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,
  1453. 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1454. static const struct wacom_features wacom_features_0xE3 =
  1455. { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,
  1456. 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1457. static const struct wacom_features wacom_features_0xE6 =
  1458. { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255,
  1459. 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1460. static const struct wacom_features wacom_features_0xEC =
  1461. { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255,
  1462. 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1463. static const struct wacom_features wacom_features_0x47 =
  1464. { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
  1465. 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1466. static const struct wacom_features wacom_features_0x84 =
  1467. { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0,
  1468. 0, WIRELESS, 0, 0 };
  1469. static const struct wacom_features wacom_features_0xD0 =
  1470. { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
  1471. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1472. static const struct wacom_features wacom_features_0xD1 =
  1473. { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
  1474. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1475. static const struct wacom_features wacom_features_0xD2 =
  1476. { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
  1477. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1478. static const struct wacom_features wacom_features_0xD3 =
  1479. { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
  1480. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1481. static const struct wacom_features wacom_features_0xD4 =
  1482. { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
  1483. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1484. static const struct wacom_features wacom_features_0xD5 =
  1485. { "Wacom Bamboo Pen 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
  1486. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1487. static const struct wacom_features wacom_features_0xD6 =
  1488. { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
  1489. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1490. static const struct wacom_features wacom_features_0xD7 =
  1491. { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
  1492. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1493. static const struct wacom_features wacom_features_0xD8 =
  1494. { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
  1495. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1496. static const struct wacom_features wacom_features_0xDA =
  1497. { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
  1498. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1499. static struct wacom_features wacom_features_0xDB =
  1500. { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
  1501. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1502. static const struct wacom_features wacom_features_0xDD =
  1503. { "Wacom Bamboo Connect", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023,
  1504. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1505. static const struct wacom_features wacom_features_0xDE =
  1506. { "Wacom Bamboo 16FG 4x5", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023,
  1507. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1508. static const struct wacom_features wacom_features_0xDF =
  1509. { "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023,
  1510. 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1511. static const struct wacom_features wacom_features_0x6004 =
  1512. { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
  1513. 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  1514. #define USB_DEVICE_WACOM(prod) \
  1515. USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
  1516. .driver_info = (kernel_ulong_t)&wacom_features_##prod
  1517. #define USB_DEVICE_DETAILED(prod, class, sub, proto) \
  1518. USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_WACOM, prod, class, \
  1519. sub, proto), \
  1520. .driver_info = (kernel_ulong_t)&wacom_features_##prod
  1521. #define USB_DEVICE_LENOVO(prod) \
  1522. USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \
  1523. .driver_info = (kernel_ulong_t)&wacom_features_##prod
  1524. const struct usb_device_id wacom_ids[] = {
  1525. { USB_DEVICE_WACOM(0x00) },
  1526. { USB_DEVICE_WACOM(0x10) },
  1527. { USB_DEVICE_WACOM(0x11) },
  1528. { USB_DEVICE_WACOM(0x12) },
  1529. { USB_DEVICE_WACOM(0x13) },
  1530. { USB_DEVICE_WACOM(0x14) },
  1531. { USB_DEVICE_WACOM(0x15) },
  1532. { USB_DEVICE_WACOM(0x16) },
  1533. { USB_DEVICE_WACOM(0x17) },
  1534. { USB_DEVICE_WACOM(0x18) },
  1535. { USB_DEVICE_WACOM(0x19) },
  1536. { USB_DEVICE_WACOM(0x60) },
  1537. { USB_DEVICE_WACOM(0x61) },
  1538. { USB_DEVICE_WACOM(0x62) },
  1539. { USB_DEVICE_WACOM(0x63) },
  1540. { USB_DEVICE_WACOM(0x64) },
  1541. { USB_DEVICE_WACOM(0x65) },
  1542. { USB_DEVICE_WACOM(0x69) },
  1543. { USB_DEVICE_WACOM(0x6A) },
  1544. { USB_DEVICE_WACOM(0x6B) },
  1545. { USB_DEVICE_WACOM(0x20) },
  1546. { USB_DEVICE_WACOM(0x21) },
  1547. { USB_DEVICE_WACOM(0x22) },
  1548. { USB_DEVICE_WACOM(0x23) },
  1549. { USB_DEVICE_WACOM(0x24) },
  1550. { USB_DEVICE_WACOM(0x30) },
  1551. { USB_DEVICE_WACOM(0x31) },
  1552. { USB_DEVICE_WACOM(0x32) },
  1553. { USB_DEVICE_WACOM(0x33) },
  1554. { USB_DEVICE_WACOM(0x34) },
  1555. { USB_DEVICE_WACOM(0x35) },
  1556. { USB_DEVICE_WACOM(0x37) },
  1557. { USB_DEVICE_WACOM(0x38) },
  1558. { USB_DEVICE_WACOM(0x39) },
  1559. { USB_DEVICE_WACOM(0xC4) },
  1560. { USB_DEVICE_WACOM(0xC0) },
  1561. { USB_DEVICE_WACOM(0xC2) },
  1562. { USB_DEVICE_WACOM(0x03) },
  1563. { USB_DEVICE_WACOM(0x41) },
  1564. { USB_DEVICE_WACOM(0x42) },
  1565. { USB_DEVICE_WACOM(0x43) },
  1566. { USB_DEVICE_WACOM(0x44) },
  1567. { USB_DEVICE_WACOM(0x45) },
  1568. { USB_DEVICE_WACOM(0xB0) },
  1569. { USB_DEVICE_WACOM(0xB1) },
  1570. { USB_DEVICE_WACOM(0xB2) },
  1571. { USB_DEVICE_WACOM(0xB3) },
  1572. { USB_DEVICE_WACOM(0xB4) },
  1573. { USB_DEVICE_WACOM(0xB5) },
  1574. { USB_DEVICE_WACOM(0xB7) },
  1575. { USB_DEVICE_WACOM(0xB8) },
  1576. { USB_DEVICE_WACOM(0xB9) },
  1577. { USB_DEVICE_WACOM(0xBA) },
  1578. { USB_DEVICE_WACOM(0xBB) },
  1579. { USB_DEVICE_WACOM(0xBC) },
  1580. { USB_DEVICE_WACOM(0x3F) },
  1581. { USB_DEVICE_WACOM(0xC5) },
  1582. { USB_DEVICE_WACOM(0xC6) },
  1583. { USB_DEVICE_WACOM(0xC7) },
  1584. /*
  1585. * DTU-2231 has two interfaces on the same configuration,
  1586. * only one is used.
  1587. */
  1588. { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID,
  1589. USB_INTERFACE_SUBCLASS_BOOT,
  1590. USB_INTERFACE_PROTOCOL_MOUSE) },
  1591. { USB_DEVICE_WACOM(0x84) },
  1592. { USB_DEVICE_WACOM(0xD0) },
  1593. { USB_DEVICE_WACOM(0xD1) },
  1594. { USB_DEVICE_WACOM(0xD2) },
  1595. { USB_DEVICE_WACOM(0xD3) },
  1596. { USB_DEVICE_WACOM(0xD4) },
  1597. { USB_DEVICE_WACOM(0xD5) },
  1598. { USB_DEVICE_WACOM(0xD6) },
  1599. { USB_DEVICE_WACOM(0xD7) },
  1600. { USB_DEVICE_WACOM(0xD8) },
  1601. { USB_DEVICE_WACOM(0xDA) },
  1602. { USB_DEVICE_WACOM(0xDB) },
  1603. { USB_DEVICE_WACOM(0xDD) },
  1604. { USB_DEVICE_WACOM(0xDE) },
  1605. { USB_DEVICE_WACOM(0xDF) },
  1606. { USB_DEVICE_WACOM(0xF0) },
  1607. { USB_DEVICE_WACOM(0xCC) },
  1608. { USB_DEVICE_WACOM(0x90) },
  1609. { USB_DEVICE_WACOM(0x93) },
  1610. { USB_DEVICE_WACOM(0x97) },
  1611. { USB_DEVICE_WACOM(0x9A) },
  1612. { USB_DEVICE_WACOM(0x9F) },
  1613. { USB_DEVICE_WACOM(0xE2) },
  1614. { USB_DEVICE_WACOM(0xE3) },
  1615. { USB_DEVICE_WACOM(0xE6) },
  1616. { USB_DEVICE_WACOM(0xEC) },
  1617. { USB_DEVICE_WACOM(0x47) },
  1618. { USB_DEVICE_WACOM(0xF4) },
  1619. { USB_DEVICE_LENOVO(0x6004) },
  1620. { }
  1621. };
  1622. MODULE_DEVICE_TABLE(usb, wacom_ids);