wacom_sys.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. /*
  2. * drivers/input/tablet/wacom_sys.c
  3. *
  4. * USB Wacom Graphire and Wacom Intuos tablet support - system specific code
  5. */
  6. /*
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. */
  12. #include "wacom.h"
  13. #include "wacom_wac.h"
  14. /* defines to get HID report descriptor */
  15. #define HID_DEVICET_HID (USB_TYPE_CLASS | 0x01)
  16. #define HID_DEVICET_REPORT (USB_TYPE_CLASS | 0x02)
  17. #define HID_USAGE_UNDEFINED 0x00
  18. #define HID_USAGE_PAGE 0x05
  19. #define HID_USAGE_PAGE_DIGITIZER 0x0d
  20. #define HID_USAGE_PAGE_DESKTOP 0x01
  21. #define HID_USAGE 0x09
  22. #define HID_USAGE_X 0x30
  23. #define HID_USAGE_Y 0x31
  24. #define HID_USAGE_X_TILT 0x3d
  25. #define HID_USAGE_Y_TILT 0x3e
  26. #define HID_USAGE_FINGER 0x22
  27. #define HID_USAGE_STYLUS 0x20
  28. #define HID_COLLECTION 0xc0
  29. enum {
  30. WCM_UNDEFINED = 0,
  31. WCM_DESKTOP,
  32. WCM_DIGITIZER,
  33. };
  34. struct hid_descriptor {
  35. struct usb_descriptor_header header;
  36. __le16 bcdHID;
  37. u8 bCountryCode;
  38. u8 bNumDescriptors;
  39. u8 bDescriptorType;
  40. __le16 wDescriptorLength;
  41. } __attribute__ ((packed));
  42. /* defines to get/set USB message */
  43. #define USB_REQ_GET_REPORT 0x01
  44. #define USB_REQ_SET_REPORT 0x09
  45. #define WAC_HID_FEATURE_REPORT 0x03
  46. static int usb_get_report(struct usb_interface *intf, unsigned char type,
  47. unsigned char id, void *buf, int size)
  48. {
  49. return usb_control_msg(interface_to_usbdev(intf),
  50. usb_rcvctrlpipe(interface_to_usbdev(intf), 0),
  51. USB_REQ_GET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
  52. (type << 8) + id, intf->altsetting[0].desc.bInterfaceNumber,
  53. buf, size, 100);
  54. }
  55. static int usb_set_report(struct usb_interface *intf, unsigned char type,
  56. unsigned char id, void *buf, int size)
  57. {
  58. return usb_control_msg(interface_to_usbdev(intf),
  59. usb_sndctrlpipe(interface_to_usbdev(intf), 0),
  60. USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
  61. (type << 8) + id, intf->altsetting[0].desc.bInterfaceNumber,
  62. buf, size, 1000);
  63. }
  64. static struct input_dev * get_input_dev(struct wacom_combo *wcombo)
  65. {
  66. return wcombo->wacom->dev;
  67. }
  68. static void wacom_sys_irq(struct urb *urb)
  69. {
  70. struct wacom *wacom = urb->context;
  71. struct wacom_combo wcombo;
  72. int retval;
  73. switch (urb->status) {
  74. case 0:
  75. /* success */
  76. break;
  77. case -ECONNRESET:
  78. case -ENOENT:
  79. case -ESHUTDOWN:
  80. /* this urb is terminated, clean up */
  81. dbg("%s - urb shutting down with status: %d", __func__, urb->status);
  82. return;
  83. default:
  84. dbg("%s - nonzero urb status received: %d", __func__, urb->status);
  85. goto exit;
  86. }
  87. wcombo.wacom = wacom;
  88. wcombo.urb = urb;
  89. if (wacom_wac_irq(wacom->wacom_wac, (void *)&wcombo))
  90. input_sync(get_input_dev(&wcombo));
  91. exit:
  92. usb_mark_last_busy(wacom->usbdev);
  93. retval = usb_submit_urb (urb, GFP_ATOMIC);
  94. if (retval)
  95. err ("%s - usb_submit_urb failed with result %d",
  96. __func__, retval);
  97. }
  98. void wacom_report_key(void *wcombo, unsigned int key_type, int key_data)
  99. {
  100. input_report_key(get_input_dev((struct wacom_combo *)wcombo), key_type, key_data);
  101. }
  102. void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data)
  103. {
  104. input_report_abs(get_input_dev((struct wacom_combo *)wcombo), abs_type, abs_data);
  105. }
  106. void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data)
  107. {
  108. input_report_rel(get_input_dev((struct wacom_combo *)wcombo), rel_type, rel_data);
  109. }
  110. void wacom_input_event(void *wcombo, unsigned int type, unsigned int code, int value)
  111. {
  112. input_event(get_input_dev((struct wacom_combo *)wcombo), type, code, value);
  113. }
  114. __u16 wacom_be16_to_cpu(unsigned char *data)
  115. {
  116. __u16 value;
  117. value = be16_to_cpu(*(__be16 *) data);
  118. return value;
  119. }
  120. __u16 wacom_le16_to_cpu(unsigned char *data)
  121. {
  122. __u16 value;
  123. value = le16_to_cpu(*(__le16 *) data);
  124. return value;
  125. }
  126. void wacom_input_sync(void *wcombo)
  127. {
  128. input_sync(get_input_dev((struct wacom_combo *)wcombo));
  129. }
  130. static int wacom_open(struct input_dev *dev)
  131. {
  132. struct wacom *wacom = input_get_drvdata(dev);
  133. mutex_lock(&wacom->lock);
  134. wacom->irq->dev = wacom->usbdev;
  135. if (usb_autopm_get_interface(wacom->intf) < 0) {
  136. mutex_unlock(&wacom->lock);
  137. return -EIO;
  138. }
  139. if (usb_submit_urb(wacom->irq, GFP_KERNEL)) {
  140. usb_autopm_put_interface(wacom->intf);
  141. mutex_unlock(&wacom->lock);
  142. return -EIO;
  143. }
  144. wacom->open = 1;
  145. wacom->intf->needs_remote_wakeup = 1;
  146. mutex_unlock(&wacom->lock);
  147. return 0;
  148. }
  149. static void wacom_close(struct input_dev *dev)
  150. {
  151. struct wacom *wacom = input_get_drvdata(dev);
  152. mutex_lock(&wacom->lock);
  153. usb_kill_urb(wacom->irq);
  154. wacom->open = 0;
  155. wacom->intf->needs_remote_wakeup = 0;
  156. mutex_unlock(&wacom->lock);
  157. }
  158. void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  159. {
  160. input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_1) |
  161. BIT_MASK(BTN_5);
  162. input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
  163. }
  164. void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  165. {
  166. input_dev->evbit[0] |= BIT_MASK(EV_MSC);
  167. input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL);
  168. input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER);
  169. input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) |
  170. BIT_MASK(BTN_4);
  171. }
  172. void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  173. {
  174. input_dev->evbit[0] |= BIT_MASK(EV_REL);
  175. input_dev->relbit[0] |= BIT_MASK(REL_WHEEL);
  176. input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_LEFT) |
  177. BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
  178. input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) |
  179. BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2);
  180. input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0);
  181. }
  182. void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  183. {
  184. input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER);
  185. input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) |
  186. BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3);
  187. input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
  188. input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
  189. }
  190. void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  191. {
  192. input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_4) |
  193. BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7);
  194. input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
  195. }
  196. void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  197. {
  198. input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9);
  199. }
  200. void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  201. {
  202. input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL);
  203. input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL);
  204. input_dev->relbit[0] |= BIT_MASK(REL_WHEEL);
  205. input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_LEFT) |
  206. BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) |
  207. BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA);
  208. input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) |
  209. BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_TOOL_BRUSH) |
  210. BIT_MASK(BTN_TOOL_PENCIL) | BIT_MASK(BTN_TOOL_AIRBRUSH) |
  211. BIT_MASK(BTN_TOOL_LENS) | BIT_MASK(BTN_STYLUS2);
  212. input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0);
  213. input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0);
  214. input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0);
  215. input_set_abs_params(input_dev, ABS_TILT_Y, 0, 127, 0, 0);
  216. input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0);
  217. input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);
  218. }
  219. void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  220. {
  221. input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2);
  222. }
  223. void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  224. {
  225. input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER);
  226. }
  227. static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc,
  228. struct wacom_wac *wacom_wac)
  229. {
  230. struct usb_device *dev = interface_to_usbdev(intf);
  231. struct wacom_features *features = wacom_wac->features;
  232. char limit = 0, result = 0;
  233. int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
  234. unsigned char *report;
  235. report = kzalloc(hid_desc->wDescriptorLength, GFP_KERNEL);
  236. if (!report)
  237. return -ENOMEM;
  238. /* retrive report descriptors */
  239. do {
  240. result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
  241. USB_REQ_GET_DESCRIPTOR,
  242. USB_RECIP_INTERFACE | USB_DIR_IN,
  243. HID_DEVICET_REPORT << 8,
  244. intf->altsetting[0].desc.bInterfaceNumber, /* interface */
  245. report,
  246. hid_desc->wDescriptorLength,
  247. 5000); /* 5 secs */
  248. } while (result < 0 && limit++ < 5);
  249. if (result < 0)
  250. goto out;
  251. for (i = 0; i < hid_desc->wDescriptorLength; i++) {
  252. switch (report[i]) {
  253. case HID_USAGE_PAGE:
  254. switch (report[i + 1]) {
  255. case HID_USAGE_PAGE_DIGITIZER:
  256. usage = WCM_DIGITIZER;
  257. i++;
  258. break;
  259. case HID_USAGE_PAGE_DESKTOP:
  260. usage = WCM_DESKTOP;
  261. i++;
  262. break;
  263. }
  264. break;
  265. case HID_USAGE:
  266. switch (report[i + 1]) {
  267. case HID_USAGE_X:
  268. if (usage == WCM_DESKTOP) {
  269. if (finger) {
  270. features->touch_x_max =
  271. features->touch_y_max =
  272. wacom_le16_to_cpu(&report[i + 3]);
  273. features->x_max =
  274. wacom_le16_to_cpu(&report[i + 6]);
  275. i += 7;
  276. } else if (pen) {
  277. features->x_max =
  278. wacom_le16_to_cpu(&report[i + 3]);
  279. i += 4;
  280. }
  281. } else if (usage == WCM_DIGITIZER) {
  282. /* max pressure isn't reported
  283. features->pressure_max = (unsigned short)
  284. (report[i+4] << 8 | report[i + 3]);
  285. */
  286. features->pressure_max = 255;
  287. i += 4;
  288. }
  289. break;
  290. case HID_USAGE_Y:
  291. if (usage == WCM_DESKTOP)
  292. features->y_max =
  293. wacom_le16_to_cpu(&report[i + 3]);
  294. i += 4;
  295. break;
  296. case HID_USAGE_FINGER:
  297. finger = 1;
  298. i++;
  299. break;
  300. case HID_USAGE_STYLUS:
  301. pen = 1;
  302. i++;
  303. break;
  304. case HID_USAGE_UNDEFINED:
  305. if (usage == WCM_DESKTOP && finger) /* capacity */
  306. features->pressure_max =
  307. wacom_le16_to_cpu(&report[i + 3]);
  308. i += 4;
  309. break;
  310. }
  311. break;
  312. case HID_COLLECTION:
  313. /* reset UsagePage ans Finger */
  314. finger = usage = 0;
  315. break;
  316. }
  317. }
  318. result = 0;
  319. out:
  320. kfree(report);
  321. return result;
  322. }
  323. static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
  324. {
  325. struct usb_device *dev = interface_to_usbdev(intf);
  326. struct usb_host_interface *interface = intf->cur_altsetting;
  327. struct usb_endpoint_descriptor *endpoint;
  328. struct wacom *wacom;
  329. struct wacom_wac *wacom_wac;
  330. struct wacom_features *features;
  331. struct input_dev *input_dev;
  332. int error = -ENOMEM;
  333. char rep_data[2], limit = 0;
  334. struct hid_descriptor *hid_desc;
  335. wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
  336. wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL);
  337. input_dev = input_allocate_device();
  338. if (!wacom || !input_dev || !wacom_wac)
  339. goto fail1;
  340. wacom_wac->data = usb_buffer_alloc(dev, 10, GFP_KERNEL, &wacom->data_dma);
  341. if (!wacom_wac->data)
  342. goto fail1;
  343. wacom->irq = usb_alloc_urb(0, GFP_KERNEL);
  344. if (!wacom->irq)
  345. goto fail2;
  346. wacom->usbdev = dev;
  347. wacom->dev = input_dev;
  348. wacom->intf = intf;
  349. mutex_init(&wacom->lock);
  350. usb_make_path(dev, wacom->phys, sizeof(wacom->phys));
  351. strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
  352. wacom_wac->features = features = get_wacom_feature(id);
  353. BUG_ON(features->pktlen > 10);
  354. input_dev->name = wacom_wac->features->name;
  355. wacom->wacom_wac = wacom_wac;
  356. usb_to_input_id(dev, &input_dev->id);
  357. input_dev->dev.parent = &intf->dev;
  358. input_set_drvdata(input_dev, wacom);
  359. input_dev->open = wacom_open;
  360. input_dev->close = wacom_close;
  361. endpoint = &intf->cur_altsetting->endpoint[0].desc;
  362. /* TabletPC need to retrieve the physical and logical maximum from report descriptor */
  363. if (wacom_wac->features->type == TABLETPC) {
  364. if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
  365. if (usb_get_extra_descriptor(&interface->endpoint[0],
  366. HID_DEVICET_REPORT, &hid_desc)) {
  367. printk("wacom: can not retrive extra class descriptor\n");
  368. goto fail2;
  369. }
  370. }
  371. error = wacom_parse_hid(intf, hid_desc, wacom_wac);
  372. if (error)
  373. goto fail2;
  374. }
  375. input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
  376. input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) |
  377. BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS);
  378. input_set_abs_params(input_dev, ABS_X, 0, features->x_max, 4, 0);
  379. input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 4, 0);
  380. input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 0, 0);
  381. if (features->type == TABLETPC) {
  382. input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_DOUBLETAP);
  383. input_set_abs_params(input_dev, ABS_RX, 0, features->touch_x_max, 4, 0);
  384. input_set_abs_params(input_dev, ABS_RY, 0, features->touch_y_max, 4, 0);
  385. }
  386. input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC);
  387. wacom_init_input_dev(input_dev, wacom_wac);
  388. usb_fill_int_urb(wacom->irq, dev,
  389. usb_rcvintpipe(dev, endpoint->bEndpointAddress),
  390. wacom_wac->data, wacom_wac->features->pktlen,
  391. wacom_sys_irq, wacom, endpoint->bInterval);
  392. wacom->irq->transfer_dma = wacom->data_dma;
  393. wacom->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
  394. error = input_register_device(wacom->dev);
  395. if (error)
  396. goto fail3;
  397. /*
  398. * Ask the tablet to report tablet data if it is not a Tablet PC.
  399. * Repeat until it succeeds
  400. */
  401. if (wacom_wac->features->type != TABLETPC) {
  402. do {
  403. rep_data[0] = 2;
  404. rep_data[1] = 2;
  405. error = usb_set_report(intf, WAC_HID_FEATURE_REPORT,
  406. 2, rep_data, 2);
  407. if (error >= 0)
  408. error = usb_get_report(intf,
  409. WAC_HID_FEATURE_REPORT, 2,
  410. rep_data, 2);
  411. } while ((error < 0 || rep_data[1] != 2) && limit++ < 5);
  412. }
  413. usb_set_intfdata(intf, wacom);
  414. return 0;
  415. fail3: usb_free_urb(wacom->irq);
  416. fail2: usb_buffer_free(dev, 10, wacom_wac->data, wacom->data_dma);
  417. fail1: input_free_device(input_dev);
  418. kfree(wacom);
  419. kfree(wacom_wac);
  420. return error;
  421. }
  422. static void wacom_disconnect(struct usb_interface *intf)
  423. {
  424. struct wacom *wacom = usb_get_intfdata(intf);
  425. usb_set_intfdata(intf, NULL);
  426. usb_kill_urb(wacom->irq);
  427. input_unregister_device(wacom->dev);
  428. usb_free_urb(wacom->irq);
  429. usb_buffer_free(interface_to_usbdev(intf), 10,
  430. wacom->wacom_wac->data, wacom->data_dma);
  431. kfree(wacom->wacom_wac);
  432. kfree(wacom);
  433. }
  434. static int wacom_suspend(struct usb_interface *intf, pm_message_t message)
  435. {
  436. struct wacom *wacom = usb_get_intfdata(intf);
  437. mutex_lock(&wacom->lock);
  438. usb_kill_urb(wacom->irq);
  439. mutex_unlock(&wacom->lock);
  440. return 0;
  441. }
  442. static int wacom_resume(struct usb_interface *intf)
  443. {
  444. struct wacom *wacom = usb_get_intfdata(intf);
  445. int rv;
  446. mutex_lock(&wacom->lock);
  447. if (wacom->open)
  448. rv = usb_submit_urb(wacom->irq, GFP_NOIO);
  449. else
  450. rv = 0;
  451. mutex_unlock(&wacom->lock);
  452. return rv;
  453. }
  454. static int wacom_reset_resume(struct usb_interface *intf)
  455. {
  456. return wacom_resume(intf);
  457. }
  458. static struct usb_driver wacom_driver = {
  459. .name = "wacom",
  460. .probe = wacom_probe,
  461. .disconnect = wacom_disconnect,
  462. .suspend = wacom_suspend,
  463. .resume = wacom_resume,
  464. .reset_resume = wacom_reset_resume,
  465. .supports_autosuspend = 1,
  466. };
  467. static int __init wacom_init(void)
  468. {
  469. int result;
  470. wacom_driver.id_table = get_device_table();
  471. result = usb_register(&wacom_driver);
  472. if (result == 0)
  473. printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
  474. DRIVER_DESC "\n");
  475. return result;
  476. }
  477. static void __exit wacom_exit(void)
  478. {
  479. usb_deregister(&wacom_driver);
  480. }
  481. module_init(wacom_init);
  482. module_exit(wacom_exit);