mISDN: Added PH_* state info to tei manager.
[linux-2.6/cjktty.git] / drivers / hid / hid-wacom.c
blob067e2963314c6882a9f7854267048658388d2aea
1 /*
2 * Bluetooth Wacom Tablet support
4 * Copyright (c) 1999 Andreas Gal
5 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
6 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
7 * Copyright (c) 2006-2007 Jiri Kosina
8 * Copyright (c) 2007 Paul Walmsley
9 * Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com>
10 * Copyright (c) 2006 Andrew Zabolotny <zap@homelink.ru>
11 * Copyright (c) 2009 Bastien Nocera <hadess@hadess.net>
12 * Copyright (c) 2011 Przemysław Firszt <przemo@firszt.eu>
16 * This program is free software; you can redistribute it and/or modify it
17 * under the terms of the GNU General Public License as published by the Free
18 * Software Foundation; either version 2 of the License, or (at your option)
19 * any later version.
22 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24 #include <linux/device.h>
25 #include <linux/hid.h>
26 #include <linux/module.h>
27 #include <linux/slab.h>
28 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
29 #include <linux/power_supply.h>
30 #endif
32 #include "hid-ids.h"
34 #define PAD_DEVICE_ID 0x0F
36 struct wacom_data {
37 __u16 tool;
38 __u16 butstate;
39 __u8 whlstate;
40 __u8 features;
41 __u32 id;
42 __u32 serial;
43 unsigned char high_speed;
44 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
45 int battery_capacity;
46 struct power_supply battery;
47 struct power_supply ac;
48 #endif
51 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
52 /*percent of battery capacity, 0 means AC online*/
53 static unsigned short batcap[8] = { 1, 15, 25, 35, 50, 70, 100, 0 };
55 static enum power_supply_property wacom_battery_props[] = {
56 POWER_SUPPLY_PROP_PRESENT,
57 POWER_SUPPLY_PROP_CAPACITY,
58 POWER_SUPPLY_PROP_SCOPE,
61 static enum power_supply_property wacom_ac_props[] = {
62 POWER_SUPPLY_PROP_PRESENT,
63 POWER_SUPPLY_PROP_ONLINE,
64 POWER_SUPPLY_PROP_SCOPE,
67 static int wacom_battery_get_property(struct power_supply *psy,
68 enum power_supply_property psp,
69 union power_supply_propval *val)
71 struct wacom_data *wdata = container_of(psy,
72 struct wacom_data, battery);
73 int power_state = batcap[wdata->battery_capacity];
74 int ret = 0;
76 switch (psp) {
77 case POWER_SUPPLY_PROP_PRESENT:
78 val->intval = 1;
79 break;
80 case POWER_SUPPLY_PROP_SCOPE:
81 val->intval = POWER_SUPPLY_SCOPE_DEVICE;
82 break;
83 case POWER_SUPPLY_PROP_CAPACITY:
84 /* show 100% battery capacity when charging */
85 if (power_state == 0)
86 val->intval = 100;
87 else
88 val->intval = power_state;
89 break;
90 default:
91 ret = -EINVAL;
92 break;
94 return ret;
97 static int wacom_ac_get_property(struct power_supply *psy,
98 enum power_supply_property psp,
99 union power_supply_propval *val)
101 struct wacom_data *wdata = container_of(psy, struct wacom_data, ac);
102 int power_state = batcap[wdata->battery_capacity];
103 int ret = 0;
105 switch (psp) {
106 case POWER_SUPPLY_PROP_PRESENT:
107 /* fall through */
108 case POWER_SUPPLY_PROP_ONLINE:
109 if (power_state == 0)
110 val->intval = 1;
111 else
112 val->intval = 0;
113 break;
114 case POWER_SUPPLY_PROP_SCOPE:
115 val->intval = POWER_SUPPLY_SCOPE_DEVICE;
116 break;
117 default:
118 ret = -EINVAL;
119 break;
121 return ret;
123 #endif
125 static void wacom_set_features(struct hid_device *hdev)
127 int ret;
128 __u8 rep_data[2];
130 /*set high speed, tablet mode*/
131 rep_data[0] = 0x03;
132 rep_data[1] = 0x20;
133 ret = hdev->hid_output_raw_report(hdev, rep_data, 2,
134 HID_FEATURE_REPORT);
135 return;
138 static void wacom_poke(struct hid_device *hdev, u8 speed)
140 struct wacom_data *wdata = hid_get_drvdata(hdev);
141 int limit, ret;
142 char rep_data[2];
144 rep_data[0] = 0x03 ; rep_data[1] = 0x00;
145 limit = 3;
146 do {
147 ret = hdev->hid_output_raw_report(hdev, rep_data, 2,
148 HID_FEATURE_REPORT);
149 } while (ret < 0 && limit-- > 0);
151 if (ret >= 0) {
152 if (speed == 0)
153 rep_data[0] = 0x05;
154 else
155 rep_data[0] = 0x06;
157 rep_data[1] = 0x00;
158 limit = 3;
159 do {
160 ret = hdev->hid_output_raw_report(hdev, rep_data, 2,
161 HID_FEATURE_REPORT);
162 } while (ret < 0 && limit-- > 0);
164 if (ret >= 0) {
165 wdata->high_speed = speed;
166 return;
171 * Note that if the raw queries fail, it's not a hard failure and it
172 * is safe to continue
174 hid_warn(hdev, "failed to poke device, command %d, err %d\n",
175 rep_data[0], ret);
176 return;
179 static ssize_t wacom_show_speed(struct device *dev,
180 struct device_attribute
181 *attr, char *buf)
183 struct wacom_data *wdata = dev_get_drvdata(dev);
185 return snprintf(buf, PAGE_SIZE, "%i\n", wdata->high_speed);
188 static ssize_t wacom_store_speed(struct device *dev,
189 struct device_attribute *attr,
190 const char *buf, size_t count)
192 struct hid_device *hdev = container_of(dev, struct hid_device, dev);
193 int new_speed;
195 if (sscanf(buf, "%1d", &new_speed ) != 1)
196 return -EINVAL;
198 if (new_speed == 0 || new_speed == 1) {
199 wacom_poke(hdev, new_speed);
200 return strnlen(buf, PAGE_SIZE);
201 } else
202 return -EINVAL;
205 static DEVICE_ATTR(speed, S_IRUGO | S_IWUSR | S_IWGRP,
206 wacom_show_speed, wacom_store_speed);
208 static int wacom_gr_parse_report(struct hid_device *hdev,
209 struct wacom_data *wdata,
210 struct input_dev *input, unsigned char *data)
212 int tool, x, y, rw;
214 tool = 0;
215 /* Get X & Y positions */
216 x = le16_to_cpu(*(__le16 *) &data[2]);
217 y = le16_to_cpu(*(__le16 *) &data[4]);
219 /* Get current tool identifier */
220 if (data[1] & 0x90) { /* If pen is in the in/active area */
221 switch ((data[1] >> 5) & 3) {
222 case 0: /* Pen */
223 tool = BTN_TOOL_PEN;
224 break;
226 case 1: /* Rubber */
227 tool = BTN_TOOL_RUBBER;
228 break;
230 case 2: /* Mouse with wheel */
231 case 3: /* Mouse without wheel */
232 tool = BTN_TOOL_MOUSE;
233 break;
236 /* Reset tool if out of active tablet area */
237 if (!(data[1] & 0x10))
238 tool = 0;
241 /* If tool changed, notify input subsystem */
242 if (wdata->tool != tool) {
243 if (wdata->tool) {
244 /* Completely reset old tool state */
245 if (wdata->tool == BTN_TOOL_MOUSE) {
246 input_report_key(input, BTN_LEFT, 0);
247 input_report_key(input, BTN_RIGHT, 0);
248 input_report_key(input, BTN_MIDDLE, 0);
249 input_report_abs(input, ABS_DISTANCE,
250 input_abs_get_max(input, ABS_DISTANCE));
251 } else {
252 input_report_key(input, BTN_TOUCH, 0);
253 input_report_key(input, BTN_STYLUS, 0);
254 input_report_key(input, BTN_STYLUS2, 0);
255 input_report_abs(input, ABS_PRESSURE, 0);
257 input_report_key(input, wdata->tool, 0);
258 input_sync(input);
260 wdata->tool = tool;
261 if (tool)
262 input_report_key(input, tool, 1);
265 if (tool) {
266 input_report_abs(input, ABS_X, x);
267 input_report_abs(input, ABS_Y, y);
269 switch ((data[1] >> 5) & 3) {
270 case 2: /* Mouse with wheel */
271 input_report_key(input, BTN_MIDDLE, data[1] & 0x04);
272 rw = (data[6] & 0x01) ? -1 :
273 (data[6] & 0x02) ? 1 : 0;
274 input_report_rel(input, REL_WHEEL, rw);
275 /* fall through */
277 case 3: /* Mouse without wheel */
278 input_report_key(input, BTN_LEFT, data[1] & 0x01);
279 input_report_key(input, BTN_RIGHT, data[1] & 0x02);
280 /* Compute distance between mouse and tablet */
281 rw = 44 - (data[6] >> 2);
282 if (rw < 0)
283 rw = 0;
284 else if (rw > 31)
285 rw = 31;
286 input_report_abs(input, ABS_DISTANCE, rw);
287 break;
289 default:
290 input_report_abs(input, ABS_PRESSURE,
291 data[6] | (((__u16) (data[1] & 0x08)) << 5));
292 input_report_key(input, BTN_TOUCH, data[1] & 0x01);
293 input_report_key(input, BTN_STYLUS, data[1] & 0x02);
294 input_report_key(input, BTN_STYLUS2, (tool == BTN_TOOL_PEN) && data[1] & 0x04);
295 break;
298 input_sync(input);
301 /* Report the state of the two buttons at the top of the tablet
302 * as two extra fingerpad keys (buttons 4 & 5). */
303 rw = data[7] & 0x03;
304 if (rw != wdata->butstate) {
305 wdata->butstate = rw;
306 input_report_key(input, BTN_0, rw & 0x02);
307 input_report_key(input, BTN_1, rw & 0x01);
308 input_report_key(input, BTN_TOOL_FINGER, 0xf0);
309 input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
310 input_sync(input);
313 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
314 /* Store current battery capacity */
315 rw = (data[7] >> 2 & 0x07);
316 if (rw != wdata->battery_capacity)
317 wdata->battery_capacity = rw;
318 #endif
319 return 1;
322 static void wacom_i4_parse_button_report(struct wacom_data *wdata,
323 struct input_dev *input, unsigned char *data)
325 __u16 new_butstate;
326 __u8 new_whlstate;
327 __u8 sync = 0;
329 new_whlstate = data[1];
330 if (new_whlstate != wdata->whlstate) {
331 wdata->whlstate = new_whlstate;
332 if (new_whlstate & 0x80) {
333 input_report_key(input, BTN_TOUCH, 1);
334 input_report_abs(input, ABS_WHEEL, (new_whlstate & 0x7f));
335 input_report_key(input, BTN_TOOL_FINGER, 1);
336 } else {
337 input_report_key(input, BTN_TOUCH, 0);
338 input_report_abs(input, ABS_WHEEL, 0);
339 input_report_key(input, BTN_TOOL_FINGER, 0);
341 sync = 1;
344 new_butstate = (data[3] << 1) | (data[2] & 0x01);
345 if (new_butstate != wdata->butstate) {
346 wdata->butstate = new_butstate;
347 input_report_key(input, BTN_0, new_butstate & 0x001);
348 input_report_key(input, BTN_1, new_butstate & 0x002);
349 input_report_key(input, BTN_2, new_butstate & 0x004);
350 input_report_key(input, BTN_3, new_butstate & 0x008);
351 input_report_key(input, BTN_4, new_butstate & 0x010);
352 input_report_key(input, BTN_5, new_butstate & 0x020);
353 input_report_key(input, BTN_6, new_butstate & 0x040);
354 input_report_key(input, BTN_7, new_butstate & 0x080);
355 input_report_key(input, BTN_8, new_butstate & 0x100);
356 input_report_key(input, BTN_TOOL_FINGER, 1);
357 sync = 1;
360 if (sync) {
361 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
362 input_event(input, EV_MSC, MSC_SERIAL, 0xffffffff);
363 input_sync(input);
367 static void wacom_i4_parse_pen_report(struct wacom_data *wdata,
368 struct input_dev *input, unsigned char *data)
370 __u16 x, y, pressure;
371 __u8 distance;
373 switch (data[1]) {
374 case 0x80: /* Out of proximity report */
375 input_report_key(input, BTN_TOUCH, 0);
376 input_report_abs(input, ABS_PRESSURE, 0);
377 input_report_key(input, BTN_STYLUS, 0);
378 input_report_key(input, BTN_STYLUS2, 0);
379 input_report_key(input, wdata->tool, 0);
380 input_report_abs(input, ABS_MISC, 0);
381 input_event(input, EV_MSC, MSC_SERIAL, wdata->serial);
382 wdata->tool = 0;
383 input_sync(input);
384 break;
385 case 0xC2: /* Tool report */
386 wdata->id = ((data[2] << 4) | (data[3] >> 4) |
387 ((data[7] & 0x0f) << 20) |
388 ((data[8] & 0xf0) << 12));
389 wdata->serial = ((data[3] & 0x0f) << 28) +
390 (data[4] << 20) + (data[5] << 12) +
391 (data[6] << 4) + (data[7] >> 4);
393 switch (wdata->id) {
394 case 0x100802:
395 wdata->tool = BTN_TOOL_PEN;
396 break;
397 case 0x10080A:
398 wdata->tool = BTN_TOOL_RUBBER;
399 break;
401 break;
402 default: /* Position/pressure report */
403 x = data[2] << 9 | data[3] << 1 | ((data[9] & 0x02) >> 1);
404 y = data[4] << 9 | data[5] << 1 | (data[9] & 0x01);
405 pressure = (data[6] << 3) | ((data[7] & 0xC0) >> 5)
406 | (data[1] & 0x01);
407 distance = (data[9] >> 2) & 0x3f;
409 input_report_key(input, BTN_TOUCH, pressure > 1);
411 input_report_key(input, BTN_STYLUS, data[1] & 0x02);
412 input_report_key(input, BTN_STYLUS2, data[1] & 0x04);
413 input_report_key(input, wdata->tool, 1);
414 input_report_abs(input, ABS_X, x);
415 input_report_abs(input, ABS_Y, y);
416 input_report_abs(input, ABS_PRESSURE, pressure);
417 input_report_abs(input, ABS_DISTANCE, distance);
418 input_report_abs(input, ABS_MISC, wdata->id);
419 input_event(input, EV_MSC, MSC_SERIAL, wdata->serial);
420 input_report_key(input, wdata->tool, 1);
421 input_sync(input);
422 break;
425 return;
428 static void wacom_i4_parse_report(struct hid_device *hdev,
429 struct wacom_data *wdata,
430 struct input_dev *input, unsigned char *data)
432 switch (data[0]) {
433 case 0x00: /* Empty report */
434 break;
435 case 0x02: /* Pen report */
436 wacom_i4_parse_pen_report(wdata, input, data);
437 break;
438 case 0x03: /* Features Report */
439 wdata->features = data[2];
440 break;
441 case 0x0C: /* Button report */
442 wacom_i4_parse_button_report(wdata, input, data);
443 break;
444 default:
445 hid_err(hdev, "Unknown report: %d,%d\n", data[0], data[1]);
446 break;
450 static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
451 u8 *raw_data, int size)
453 struct wacom_data *wdata = hid_get_drvdata(hdev);
454 struct hid_input *hidinput;
455 struct input_dev *input;
456 unsigned char *data = (unsigned char *) raw_data;
457 int i;
459 if (!(hdev->claimed & HID_CLAIMED_INPUT))
460 return 0;
462 hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
463 input = hidinput->input;
465 /* Check if this is a tablet report */
466 if (data[0] != 0x03)
467 return 0;
469 switch (hdev->product) {
470 case USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH:
471 return wacom_gr_parse_report(hdev, wdata, input, data);
472 break;
473 case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
474 i = 1;
476 switch (data[0]) {
477 case 0x04:
478 wacom_i4_parse_report(hdev, wdata, input, data + i);
479 i += 10;
480 /* fall through */
481 case 0x03:
482 wacom_i4_parse_report(hdev, wdata, input, data + i);
483 i += 10;
484 wacom_i4_parse_report(hdev, wdata, input, data + i);
485 break;
486 default:
487 hid_err(hdev, "Unknown report: %d,%d size:%d\n",
488 data[0], data[1], size);
489 return 0;
492 return 1;
495 static int wacom_input_mapped(struct hid_device *hdev, struct hid_input *hi,
496 struct hid_field *field, struct hid_usage *usage, unsigned long **bit,
497 int *max)
499 struct input_dev *input = hi->input;
501 __set_bit(INPUT_PROP_POINTER, input->propbit);
503 /* Basics */
504 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL);
506 __set_bit(REL_WHEEL, input->relbit);
508 __set_bit(BTN_TOOL_PEN, input->keybit);
509 __set_bit(BTN_TOUCH, input->keybit);
510 __set_bit(BTN_STYLUS, input->keybit);
511 __set_bit(BTN_STYLUS2, input->keybit);
512 __set_bit(BTN_LEFT, input->keybit);
513 __set_bit(BTN_RIGHT, input->keybit);
514 __set_bit(BTN_MIDDLE, input->keybit);
516 /* Pad */
517 input_set_capability(input, EV_MSC, MSC_SERIAL);
519 __set_bit(BTN_0, input->keybit);
520 __set_bit(BTN_1, input->keybit);
521 __set_bit(BTN_TOOL_FINGER, input->keybit);
523 /* Distance, rubber and mouse */
524 __set_bit(BTN_TOOL_RUBBER, input->keybit);
525 __set_bit(BTN_TOOL_MOUSE, input->keybit);
527 switch (hdev->product) {
528 case USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH:
529 input_set_abs_params(input, ABS_X, 0, 16704, 4, 0);
530 input_set_abs_params(input, ABS_Y, 0, 12064, 4, 0);
531 input_set_abs_params(input, ABS_PRESSURE, 0, 511, 0, 0);
532 input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
533 break;
534 case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
535 __set_bit(ABS_WHEEL, input->absbit);
536 __set_bit(ABS_MISC, input->absbit);
537 __set_bit(BTN_2, input->keybit);
538 __set_bit(BTN_3, input->keybit);
539 __set_bit(BTN_4, input->keybit);
540 __set_bit(BTN_5, input->keybit);
541 __set_bit(BTN_6, input->keybit);
542 __set_bit(BTN_7, input->keybit);
543 __set_bit(BTN_8, input->keybit);
544 input_set_abs_params(input, ABS_WHEEL, 0, 71, 0, 0);
545 input_set_abs_params(input, ABS_X, 0, 40640, 4, 0);
546 input_set_abs_params(input, ABS_Y, 0, 25400, 4, 0);
547 input_set_abs_params(input, ABS_PRESSURE, 0, 2047, 0, 0);
548 input_set_abs_params(input, ABS_DISTANCE, 0, 63, 0, 0);
549 break;
552 return 0;
555 static int wacom_probe(struct hid_device *hdev,
556 const struct hid_device_id *id)
558 struct wacom_data *wdata;
559 int ret;
561 wdata = kzalloc(sizeof(*wdata), GFP_KERNEL);
562 if (wdata == NULL) {
563 hid_err(hdev, "can't alloc wacom descriptor\n");
564 return -ENOMEM;
567 hid_set_drvdata(hdev, wdata);
569 /* Parse the HID report now */
570 ret = hid_parse(hdev);
571 if (ret) {
572 hid_err(hdev, "parse failed\n");
573 goto err_free;
576 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
577 if (ret) {
578 hid_err(hdev, "hw start failed\n");
579 goto err_free;
582 ret = device_create_file(&hdev->dev, &dev_attr_speed);
583 if (ret)
584 hid_warn(hdev,
585 "can't create sysfs speed attribute err: %d\n", ret);
587 switch (hdev->product) {
588 case USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH:
589 /* Set Wacom mode 2 with high reporting speed */
590 wacom_poke(hdev, 1);
591 break;
592 case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
593 sprintf(hdev->name, "%s", "Wacom Intuos4 WL");
594 wdata->features = 0;
595 wacom_set_features(hdev);
596 break;
599 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
600 wdata->battery.properties = wacom_battery_props;
601 wdata->battery.num_properties = ARRAY_SIZE(wacom_battery_props);
602 wdata->battery.get_property = wacom_battery_get_property;
603 wdata->battery.name = "wacom_battery";
604 wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY;
605 wdata->battery.use_for_apm = 0;
608 ret = power_supply_register(&hdev->dev, &wdata->battery);
609 if (ret) {
610 hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n",
611 ret);
612 goto err_battery;
615 power_supply_powers(&wdata->battery, &hdev->dev);
617 wdata->ac.properties = wacom_ac_props;
618 wdata->ac.num_properties = ARRAY_SIZE(wacom_ac_props);
619 wdata->ac.get_property = wacom_ac_get_property;
620 wdata->ac.name = "wacom_ac";
621 wdata->ac.type = POWER_SUPPLY_TYPE_MAINS;
622 wdata->ac.use_for_apm = 0;
624 ret = power_supply_register(&hdev->dev, &wdata->ac);
625 if (ret) {
626 hid_warn(hdev,
627 "can't create ac battery attribute, err: %d\n", ret);
628 goto err_ac;
631 power_supply_powers(&wdata->ac, &hdev->dev);
632 #endif
633 return 0;
635 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
636 err_ac:
637 power_supply_unregister(&wdata->battery);
638 err_battery:
639 device_remove_file(&hdev->dev, &dev_attr_speed);
640 hid_hw_stop(hdev);
641 #endif
642 err_free:
643 kfree(wdata);
644 return ret;
647 static void wacom_remove(struct hid_device *hdev)
649 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
650 struct wacom_data *wdata = hid_get_drvdata(hdev);
651 #endif
652 device_remove_file(&hdev->dev, &dev_attr_speed);
653 hid_hw_stop(hdev);
655 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
656 power_supply_unregister(&wdata->battery);
657 power_supply_unregister(&wdata->ac);
658 #endif
659 kfree(hid_get_drvdata(hdev));
662 static const struct hid_device_id wacom_devices[] = {
663 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH) },
664 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH) },
668 MODULE_DEVICE_TABLE(hid, wacom_devices);
670 static struct hid_driver wacom_driver = {
671 .name = "wacom",
672 .id_table = wacom_devices,
673 .probe = wacom_probe,
674 .remove = wacom_remove,
675 .raw_event = wacom_raw_event,
676 .input_mapped = wacom_input_mapped,
679 static int __init wacom_init(void)
681 int ret;
683 ret = hid_register_driver(&wacom_driver);
684 if (ret)
685 pr_err("can't register wacom driver\n");
686 return ret;
689 static void __exit wacom_exit(void)
691 hid_unregister_driver(&wacom_driver);
694 module_init(wacom_init);
695 module_exit(wacom_exit);
696 MODULE_LICENSE("GPL");