• Home
  • Raw
  • Download

Lines Matching +full:tablet +full:- +full:mode

6  *  Copyright (c) 2002-2004 Bryan W. Headley <bwheadley@earthlink.net>
19 * v0.1 - Initial release
20 * v0.2 - Hack to get around fake event 28's. (Bryan W. Headley)
21 * v0.3 - Make URB dynamic (Bryan W. Headley, Jun-8-2002)
23 * v0.4 - Rewrote substantial portions of the code to deal with
25 * support of 6000U - 12000U, procfs, and macro key support
26 * (Jan-1-2003 - Feb-5-2003, Bryan W. Headley)
27 * v1.0 - Added support for diagnostic messages, count of messages
28 * received from URB - Mar-8-2003, Bryan W. Headley
29 * v1.1 - added support for tablet resolution, changed DV and proximity
30 * some corrections - Jun-22-2003, martin schneebacher
31 * - Added support for the sysfs interface, deprecating the
33 * Wheel command. Bryan W. Headley July-15-2003.
34 * v1.2 - Reworked jitter timer as a kernel thread.
35 * Bryan W. Headley November-28-2003/Jan-10-2004.
36 * v1.3 - Repaired issue of kernel thread going nuts on single-processor
39 * v1.4 - Re-wire jitter so it does not require a thread. Courtesy of
46 * v1.5 - Added previousJitterable, so we don't do jitter delay when the
51 * driver for your X server, as well as the Gaiptek GUI Front-end
52 * "Tablet Manager".
70 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
84 * (returned as Report 1 - relative coordinates from mouse and stylus)
92 * (returned as Report 2 - absolute coordinates from the stylus)
104 * (returned as Report 3 - absolute coordinates from the mouse)
116 * (returned as Report 4 - macrokeys from the stylus)
126 * (returned as Report 5 - macrokeys from the mouse)
139 * BS2 also referred to as Tablet Pick
160 * To initialize the tablet:
203 #define AIPTEK_TILT_MIN (-128)
205 #define AIPTEK_TILT_DISABLE (-10101)
211 #define AIPTEK_WHEEL_DISABLE (-10101)
239 /* Time to wait (in ms) in-between sending the tablet
241 * sequence from the tablet.
262 /* Length of incoming packet from the tablet
267 * whether the report came from the stylus, tablet mouse
268 * or "unknown" -- Unknown when the tablet is in relative
269 * mode, because we only get report 1's.
279 int odmCode; /* Tablet manufacturer code */
280 int modelCode; /* Tablet model code (not unique) */
286 int pointerMode; /* stylus-, mouse-only or either */
297 int programmableDelay; /* delay for tablet programming */
306 struct aiptek_features features; /* tablet's array of features */
307 struct aiptek_settings curSetting; /* tablet's current programmable */
310 int diagnostic; /* tablet diagnostic codes */
343 * the bitmap which comes from the tablet. This hides the
359 #define AIPTEK_INVALID_VALUE -1
370 if (str[count - 1] == '\n') in map_str_to_val()
371 count--; in map_str_to_val()
373 for (p = map; p->string; p++) in map_str_to_val()
374 if (!strncmp(str, p->string, count)) in map_str_to_val()
375 return p->value; in map_str_to_val()
384 for (p = map; p->value != AIPTEK_INVALID_VALUE; p++) in map_val_to_str()
385 if (val == p->value) in map_val_to_str()
386 return p->string; in map_val_to_str()
395 * The tablet reports on several attributes per invocation of
399 * a complete tablet report. Further, the number of Input Event reports
401 * To deal with this, EV_MSC is used to indicate an 'end-of-report'
403 * tablet driver and clients such as gpm and XFree86's tablet drivers.
405 * Of the information received from the tablet, the one piece I
410 * Proximity event occurred while the tablet was in absolute or relative
411 * mode.
414 * can be set and re-set. Thus, only using ABS_MISC from now on.
427 struct aiptek *aiptek = urb->context; in aiptek_irq()
428 unsigned char *data = aiptek->data; in aiptek_irq()
429 struct input_dev *inputdev = aiptek->inputdev; in aiptek_irq()
430 struct usb_interface *intf = aiptek->intf; in aiptek_irq()
434 switch (urb->status) { in aiptek_irq()
439 case -ECONNRESET: in aiptek_irq()
440 case -ENOENT: in aiptek_irq()
441 case -ESHUTDOWN: in aiptek_irq()
443 dev_dbg(&intf->dev, "%s - urb shutting down with status: %d\n", in aiptek_irq()
444 __func__, urb->status); in aiptek_irq()
448 dev_dbg(&intf->dev, "%s - nonzero urb status received: %d\n", in aiptek_irq()
449 __func__, urb->status); in aiptek_irq()
453 /* See if we are in a delay loop -- throw out report if true. in aiptek_irq()
455 if (aiptek->inDelay == 1 && time_after(aiptek->endDelay, jiffies)) { in aiptek_irq()
459 aiptek->inDelay = 0; in aiptek_irq()
460 aiptek->eventCount++; in aiptek_irq()
467 if (aiptek->curSetting.coordinateMode == in aiptek_irq()
469 aiptek->diagnostic = in aiptek_irq()
477 * to pseudo-settings. (We don't specifically care about it's in aiptek_irq()
479 * that a non-zero value indicates that one or more in aiptek_irq()
484 left = (data[1] & aiptek->curSetting.mouseButtonLeft >> 2) != 0 ? 1 : 0; in aiptek_irq()
485 right = (data[1] & aiptek->curSetting.mouseButtonRight >> 2) != 0 ? 1 : 0; in aiptek_irq()
486 middle = (data[1] & aiptek->curSetting.mouseButtonMiddle >> 2) != 0 ? 1 : 0; in aiptek_irq()
497 /* Wheel support is in the form of a single-event in aiptek_irq()
500 if (aiptek->curSetting.wheel != AIPTEK_WHEEL_DISABLE) { in aiptek_irq()
502 aiptek->curSetting.wheel); in aiptek_irq()
503 aiptek->curSetting.wheel = AIPTEK_WHEEL_DISABLE; in aiptek_irq()
505 if (aiptek->lastMacro != -1) { in aiptek_irq()
507 macroKeyEvents[aiptek->lastMacro], 0); in aiptek_irq()
508 aiptek->lastMacro = -1; in aiptek_irq()
517 if (aiptek->curSetting.coordinateMode == AIPTEK_COORDINATE_RELATIVE_MODE) { in aiptek_irq()
518 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_SENDING_ABSOLUTE_IN_RELATIVE; in aiptek_irq()
520 (aiptek->curSetting.pointerMode)) { in aiptek_irq()
521 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; in aiptek_irq()
531 /* Use jitterable to re-arrange button masks in aiptek_irq()
535 bs = (data[5] & aiptek->curSetting.stylusButtonLower) != 0 ? 1 : 0; in aiptek_irq()
536 pck = (data[5] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0; in aiptek_irq()
538 /* dv indicates 'data valid' (e.g., the tablet is in sync in aiptek_irq()
546 if (aiptek->previousToolMode != in aiptek_irq()
547 aiptek->curSetting.toolMode) { in aiptek_irq()
549 aiptek->previousToolMode, 0); in aiptek_irq()
551 aiptek->curSetting.toolMode, in aiptek_irq()
553 aiptek->previousToolMode = in aiptek_irq()
554 aiptek->curSetting.toolMode; in aiptek_irq()
566 if (aiptek->curSetting.xTilt != in aiptek_irq()
570 aiptek->curSetting.xTilt); in aiptek_irq()
572 if (aiptek->curSetting.yTilt != AIPTEK_TILT_DISABLE) { in aiptek_irq()
575 aiptek->curSetting.yTilt); in aiptek_irq()
578 /* Wheel support is in the form of a single-event in aiptek_irq()
581 if (aiptek->curSetting.wheel != in aiptek_irq()
585 aiptek->curSetting.wheel); in aiptek_irq()
586 aiptek->curSetting.wheel = AIPTEK_WHEEL_DISABLE; in aiptek_irq()
590 if (aiptek->lastMacro != -1) { in aiptek_irq()
592 macroKeyEvents[aiptek->lastMacro], 0); in aiptek_irq()
593 aiptek->lastMacro = -1; in aiptek_irq()
599 /* Report 3's come from the mouse in absolute mode. in aiptek_irq()
602 if (aiptek->curSetting.coordinateMode == AIPTEK_COORDINATE_RELATIVE_MODE) { in aiptek_irq()
603 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_SENDING_ABSOLUTE_IN_RELATIVE; in aiptek_irq()
605 (aiptek->curSetting.pointerMode)) { in aiptek_irq()
606 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; in aiptek_irq()
615 left = (data[5] & aiptek->curSetting.mouseButtonLeft) != 0 ? 1 : 0; in aiptek_irq()
616 right = (data[5] & aiptek->curSetting.mouseButtonRight) != 0 ? 1 : 0; in aiptek_irq()
617 middle = (data[5] & aiptek->curSetting.mouseButtonMiddle) != 0 ? 1 : 0; in aiptek_irq()
623 if (aiptek->previousToolMode != in aiptek_irq()
624 aiptek->curSetting.toolMode) { in aiptek_irq()
626 aiptek->previousToolMode, 0); in aiptek_irq()
628 aiptek->curSetting.toolMode, in aiptek_irq()
630 aiptek->previousToolMode = in aiptek_irq()
631 aiptek->curSetting.toolMode; in aiptek_irq()
642 /* Wheel support is in the form of a single-event in aiptek_irq()
645 if (aiptek->curSetting.wheel != AIPTEK_WHEEL_DISABLE) { in aiptek_irq()
648 aiptek->curSetting.wheel); in aiptek_irq()
649 aiptek->curSetting.wheel = AIPTEK_WHEEL_DISABLE; in aiptek_irq()
653 if (aiptek->lastMacro != -1) { in aiptek_irq()
655 macroKeyEvents[aiptek->lastMacro], 0); in aiptek_irq()
656 aiptek->lastMacro = -1; in aiptek_irq()
670 bs = (data[1] & aiptek->curSetting.stylusButtonLower) != 0 ? 1 : 0; in aiptek_irq()
671 pck = (data[1] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0; in aiptek_irq()
673 macro = dv && p && tip && !(data[3] & 1) ? (data[3] >> 1) : -1; in aiptek_irq()
680 if (aiptek->previousToolMode != in aiptek_irq()
681 aiptek->curSetting.toolMode) { in aiptek_irq()
683 aiptek->previousToolMode, 0); in aiptek_irq()
685 aiptek->curSetting.toolMode, in aiptek_irq()
687 aiptek->previousToolMode = in aiptek_irq()
688 aiptek->curSetting.toolMode; in aiptek_irq()
692 if (aiptek->lastMacro != -1 && aiptek->lastMacro != macro) { in aiptek_irq()
693 input_report_key(inputdev, macroKeyEvents[aiptek->lastMacro], 0); in aiptek_irq()
694 aiptek->lastMacro = -1; in aiptek_irq()
697 if (macro != -1 && macro != aiptek->lastMacro) { in aiptek_irq()
699 aiptek->lastMacro = macro; in aiptek_irq()
712 left = (data[1]& aiptek->curSetting.mouseButtonLeft) != 0 ? 1 : 0; in aiptek_irq()
713 right = (data[1] & aiptek->curSetting.mouseButtonRight) != 0 ? 1 : 0; in aiptek_irq()
714 middle = (data[1] & aiptek->curSetting.mouseButtonMiddle) != 0 ? 1 : 0; in aiptek_irq()
721 if (aiptek->previousToolMode != in aiptek_irq()
722 aiptek->curSetting.toolMode) { in aiptek_irq()
724 aiptek->previousToolMode, 0); in aiptek_irq()
726 aiptek->curSetting.toolMode, 1); in aiptek_irq()
727 aiptek->previousToolMode = aiptek->curSetting.toolMode; in aiptek_irq()
731 if (aiptek->lastMacro != -1 && aiptek->lastMacro != macro) { in aiptek_irq()
732 input_report_key(inputdev, macroKeyEvents[aiptek->lastMacro], 0); in aiptek_irq()
733 aiptek->lastMacro = -1; in aiptek_irq()
736 if (macro != -1 && macro != aiptek->lastMacro) { in aiptek_irq()
738 aiptek->lastMacro = macro; in aiptek_irq()
747 * However, report 6 is the 'official-looking' report for macroKeys; in aiptek_irq()
754 input_report_key(inputdev, macroKeyEvents[macro - 1], in aiptek_irq()
765 if (aiptek->previousToolMode != in aiptek_irq()
766 aiptek->curSetting.toolMode) { in aiptek_irq()
768 aiptek->previousToolMode, 0); in aiptek_irq()
770 aiptek->curSetting.toolMode, in aiptek_irq()
772 aiptek->previousToolMode = in aiptek_irq()
773 aiptek->curSetting.toolMode; in aiptek_irq()
781 dev_dbg(&intf->dev, "Unknown report %d\n", data[0]); in aiptek_irq()
789 * We just introduced aiptek->previousJitterable to carry forth the in aiptek_irq()
796 if (aiptek->previousJitterable != jitterable && in aiptek_irq()
797 aiptek->curSetting.jitterDelay != 0 && aiptek->inDelay != 1) { in aiptek_irq()
798 aiptek->endDelay = jiffies + in aiptek_irq()
799 ((aiptek->curSetting.jitterDelay * HZ) / 1000); in aiptek_irq()
800 aiptek->inDelay = 1; in aiptek_irq()
802 aiptek->previousJitterable = jitterable; in aiptek_irq()
807 dev_err(&intf->dev, in aiptek_irq()
808 "%s - usb_submit_urb failed with result %d\n", in aiptek_irq()
819 * IDs to not be model-specific nor unique.
836 * Open an instance of the tablet driver.
842 aiptek->urb->dev = interface_to_usbdev(aiptek->intf); in aiptek_open()
843 if (usb_submit_urb(aiptek->urb, GFP_KERNEL) != 0) in aiptek_open()
844 return -EIO; in aiptek_open()
850 * Close an instance of the tablet driver.
856 usb_kill_urb(aiptek->urb); in aiptek_close()
868 struct usb_device *udev = interface_to_usbdev(aiptek->intf); in aiptek_set_report()
875 aiptek->ifnum, buffer, size, 5000); in aiptek_set_report()
883 struct usb_device *udev = interface_to_usbdev(aiptek->intf); in aiptek_get_report()
890 aiptek->ifnum, buffer, size, 5000); in aiptek_get_report()
894 * Send a command to the tablet.
905 return -ENOMEM; in aiptek_command()
913 dev_dbg(&aiptek->intf->dev, in aiptek_command()
922 * Retrieve information from the tablet. Querying info is defined as first
935 return -ENOMEM; in aiptek_query()
943 return -EIO; in aiptek_query()
945 msleep(aiptek->curSetting.programmableDelay); in aiptek_query()
949 dev_dbg(&aiptek->intf->dev, in aiptek_query()
952 ret = -EIO; in aiptek_query()
961 * Program the tablet into either absolute or relative mode.
962 * We also get information about the tablet's size.
974 aiptek->features.modelCode = ret & 0xff; in aiptek_program_tablet()
979 aiptek->features.odmCode = ret; in aiptek_program_tablet()
984 aiptek->features.firmwareCode = ret; in aiptek_program_tablet()
989 input_set_abs_params(aiptek->inputdev, ABS_X, 0, ret - 1, 0, 0); in aiptek_program_tablet()
994 input_set_abs_params(aiptek->inputdev, ABS_Y, 0, ret - 1, 0, 0); in aiptek_program_tablet()
999 input_set_abs_params(aiptek->inputdev, ABS_PRESSURE, 0, ret - 1, 0, 0); in aiptek_program_tablet()
1001 /* Depending on whether we are in absolute or relative mode, we will in aiptek_program_tablet()
1004 if (aiptek->curSetting.coordinateMode == in aiptek_program_tablet()
1032 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_NA; in aiptek_program_tablet()
1033 aiptek->eventCount = 0; in aiptek_program_tablet()
1039 * Sysfs functions. Sysfs prefers that individually-tunable parameters
1040 * exist in their separate pseudo-files. Summary data that is immutable
1046 * support the 'size' file -- display support
1053 input_abs_get_max(aiptek->inputdev, ABS_X) + 1, in show_tabletSize()
1054 input_abs_get_max(aiptek->inputdev, ABS_Y) + 1); in show_tabletSize()
1060 * permitted -- it only means can't either 'cat' the file, or send data
1082 aiptek->curSetting.pointerMode)); in show_tabletPointerMode()
1092 return -EINVAL; in store_tabletPointerMode()
1094 aiptek->newSetting.pointerMode = new_mode; in store_tabletPointerMode()
1119 aiptek->curSetting.coordinateMode)); in show_tabletCoordinateMode()
1129 return -EINVAL; in store_tabletCoordinateMode()
1131 aiptek->newSetting.coordinateMode = new_mode; in store_tabletCoordinateMode()
1161 aiptek->curSetting.toolMode)); in show_tabletToolMode()
1171 return -EINVAL; in store_tabletToolMode()
1173 aiptek->newSetting.toolMode = new_mode; in store_tabletToolMode()
1189 if (aiptek->curSetting.xTilt == AIPTEK_TILT_DISABLE) { in show_tabletXtilt()
1193 aiptek->curSetting.xTilt); in show_tabletXtilt()
1204 size_t len = buf[count - 1] == '\n' ? count - 1 : count; in store_tabletXtilt()
1207 return -EINVAL; in store_tabletXtilt()
1209 aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE; in store_tabletXtilt()
1212 return -EINVAL; in store_tabletXtilt()
1214 aiptek->newSetting.xTilt = x; in store_tabletXtilt()
1231 if (aiptek->curSetting.yTilt == AIPTEK_TILT_DISABLE) { in show_tabletYtilt()
1235 aiptek->curSetting.yTilt); in show_tabletYtilt()
1246 size_t len = buf[count - 1] == '\n' ? count - 1 : count; in store_tabletYtilt()
1249 return -EINVAL; in store_tabletYtilt()
1251 aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE; in store_tabletYtilt()
1254 return -EINVAL; in store_tabletYtilt()
1256 aiptek->newSetting.yTilt = y; in store_tabletYtilt()
1273 return snprintf(buf, PAGE_SIZE, "%d\n", aiptek->curSetting.jitterDelay); in show_tabletJitterDelay()
1286 aiptek->newSetting.jitterDelay = j; in store_tabletJitterDelay()
1303 aiptek->curSetting.programmableDelay); in show_tabletProgrammableDelay()
1316 aiptek->newSetting.programmableDelay = d; in store_tabletProgrammableDelay()
1332 return snprintf(buf, PAGE_SIZE, "%ld\n", aiptek->eventCount); in show_tabletEventsReceived()
1346 switch (aiptek->diagnostic) { in show_tabletDiagnosticMessage()
1360 if (aiptek->curSetting.pointerMode == in show_tabletDiagnosticMessage()
1393 aiptek->curSetting.stylusButtonUpper)); in show_tabletStylusUpper()
1403 return -EINVAL; in store_tabletStylusUpper()
1405 aiptek->newSetting.stylusButtonUpper = new_button; in store_tabletStylusUpper()
1424 aiptek->curSetting.stylusButtonLower)); in show_tabletStylusLower()
1434 return -EINVAL; in store_tabletStylusLower()
1436 aiptek->newSetting.stylusButtonLower = new_button; in store_tabletStylusLower()
1462 aiptek->curSetting.mouseButtonLeft)); in show_tabletMouseLeft()
1472 return -EINVAL; in store_tabletMouseLeft()
1474 aiptek->newSetting.mouseButtonLeft = new_button; in store_tabletMouseLeft()
1492 aiptek->curSetting.mouseButtonMiddle)); in show_tabletMouseMiddle()
1502 return -EINVAL; in store_tabletMouseMiddle()
1504 aiptek->newSetting.mouseButtonMiddle = new_button; in store_tabletMouseMiddle()
1522 aiptek->curSetting.mouseButtonRight)); in show_tabletMouseRight()
1532 return -EINVAL; in store_tabletMouseRight()
1534 aiptek->newSetting.mouseButtonRight = new_button; in store_tabletMouseRight()
1550 if (aiptek->curSetting.wheel == AIPTEK_WHEEL_DISABLE) { in show_tabletWheel()
1554 aiptek->curSetting.wheel); in show_tabletWheel()
1568 aiptek->newSetting.wheel = w; in store_tabletWheel()
1581 /* There is nothing useful to display, so a one-line manual in show_tabletExecute()
1585 "Write anything to this file to program your tablet.\n"); in show_tabletExecute()
1594 * of writing to this file triggers a tablet reprogramming. in store_tabletExecute()
1596 memcpy(&aiptek->curSetting, &aiptek->newSetting, in store_tabletExecute()
1600 return -EIO; in store_tabletExecute()
1616 return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.odmCode); in show_tabletODMCode()
1629 return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.modelCode); in show_tabletModelCode()
1643 aiptek->features.firmwareCode); in show_firmwareCode()
1677 * This routine is called when a tablet has been identified. It basically
1678 * sets up the tablet and the driver's internal structures.
1696 int err = -ENOMEM; in aiptek_probe()
1698 /* programmableDelay is where the command-line specified in aiptek_probe()
1709 dev_warn(&intf->dev, in aiptek_probe()
1714 aiptek->data = usb_alloc_coherent(usbdev, AIPTEK_PACKET_LENGTH, in aiptek_probe()
1715 GFP_KERNEL, &aiptek->data_dma); in aiptek_probe()
1716 if (!aiptek->data) { in aiptek_probe()
1717 dev_warn(&intf->dev, "cannot allocate usb buffer\n"); in aiptek_probe()
1721 aiptek->urb = usb_alloc_urb(0, GFP_KERNEL); in aiptek_probe()
1722 if (!aiptek->urb) { in aiptek_probe()
1723 dev_warn(&intf->dev, "cannot allocate urb\n"); in aiptek_probe()
1727 aiptek->inputdev = inputdev; in aiptek_probe()
1728 aiptek->intf = intf; in aiptek_probe()
1729 aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber; in aiptek_probe()
1730 aiptek->inDelay = 0; in aiptek_probe()
1731 aiptek->endDelay = 0; in aiptek_probe()
1732 aiptek->previousJitterable = 0; in aiptek_probe()
1733 aiptek->lastMacro = -1; in aiptek_probe()
1741 aiptek->curSetting.pointerMode = AIPTEK_POINTER_EITHER_MODE; in aiptek_probe()
1742 aiptek->curSetting.coordinateMode = AIPTEK_COORDINATE_ABSOLUTE_MODE; in aiptek_probe()
1743 aiptek->curSetting.toolMode = AIPTEK_TOOL_BUTTON_PEN_MODE; in aiptek_probe()
1744 aiptek->curSetting.xTilt = AIPTEK_TILT_DISABLE; in aiptek_probe()
1745 aiptek->curSetting.yTilt = AIPTEK_TILT_DISABLE; in aiptek_probe()
1746 aiptek->curSetting.mouseButtonLeft = AIPTEK_MOUSE_LEFT_BUTTON; in aiptek_probe()
1747 aiptek->curSetting.mouseButtonMiddle = AIPTEK_MOUSE_MIDDLE_BUTTON; in aiptek_probe()
1748 aiptek->curSetting.mouseButtonRight = AIPTEK_MOUSE_RIGHT_BUTTON; in aiptek_probe()
1749 aiptek->curSetting.stylusButtonUpper = AIPTEK_STYLUS_UPPER_BUTTON; in aiptek_probe()
1750 aiptek->curSetting.stylusButtonLower = AIPTEK_STYLUS_LOWER_BUTTON; in aiptek_probe()
1751 aiptek->curSetting.jitterDelay = jitterDelay; in aiptek_probe()
1752 aiptek->curSetting.programmableDelay = programmableDelay; in aiptek_probe()
1756 aiptek->newSetting = aiptek->curSetting; in aiptek_probe()
1762 * & a tablet, and the inputX number actually will tell in aiptek_probe()
1765 usb_make_path(usbdev, aiptek->features.usbPath, in aiptek_probe()
1766 sizeof(aiptek->features.usbPath)); in aiptek_probe()
1767 strlcat(aiptek->features.usbPath, "/input0", in aiptek_probe()
1768 sizeof(aiptek->features.usbPath)); in aiptek_probe()
1773 inputdev->name = "Aiptek"; in aiptek_probe()
1774 inputdev->phys = aiptek->features.usbPath; in aiptek_probe()
1775 usb_to_input_id(usbdev, &inputdev->id); in aiptek_probe()
1776 inputdev->dev.parent = &intf->dev; in aiptek_probe()
1780 inputdev->open = aiptek_open; in aiptek_probe()
1781 inputdev->close = aiptek_close; in aiptek_probe()
1783 /* Now program the capacities of the tablet, in terms of being in aiptek_probe()
1787 __set_bit(eventTypes[i], inputdev->evbit); in aiptek_probe()
1790 __set_bit(absEvents[i], inputdev->absbit); in aiptek_probe()
1793 __set_bit(relEvents[i], inputdev->relbit); in aiptek_probe()
1795 __set_bit(MSC_SERIAL, inputdev->mscbit); in aiptek_probe()
1799 __set_bit(buttonEvents[i], inputdev->keybit); in aiptek_probe()
1802 __set_bit(macroKeyEvents[i], inputdev->keybit); in aiptek_probe()
1807 * values in. Later, we'll ask the tablet to put in the correct in aiptek_probe()
1815 input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0); in aiptek_probe()
1818 if (intf->cur_altsetting->desc.bNumEndpoints < 1) { in aiptek_probe()
1819 dev_err(&intf->dev, in aiptek_probe()
1821 intf->cur_altsetting->desc.bNumEndpoints); in aiptek_probe()
1822 err = -EINVAL; in aiptek_probe()
1825 endpoint = &intf->cur_altsetting->endpoint[0].desc; in aiptek_probe()
1827 /* Go set up our URB, which is called when the tablet receives in aiptek_probe()
1830 usb_fill_int_urb(aiptek->urb, in aiptek_probe()
1833 endpoint->bEndpointAddress), in aiptek_probe()
1834 aiptek->data, 8, aiptek_irq, aiptek, in aiptek_probe()
1835 endpoint->bInterval); in aiptek_probe()
1837 aiptek->urb->transfer_dma = aiptek->data_dma; in aiptek_probe()
1838 aiptek->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; in aiptek_probe()
1840 /* Program the tablet. This sets the tablet up in the mode in aiptek_probe()
1841 * specified in newSetting, and also queries the tablet's in aiptek_probe()
1844 * Sanity check: if a tablet doesn't like the slow programmatic in aiptek_probe()
1847 * have to explain to us how your tablet thinks it's 0x0, and yet that's in aiptek_probe()
1848 * not an error :-) in aiptek_probe()
1852 aiptek->curSetting.programmableDelay = speeds[i]; in aiptek_probe()
1854 if (input_abs_get_max(aiptek->inputdev, ABS_X) > 0) { in aiptek_probe()
1855 dev_info(&intf->dev, in aiptek_probe()
1857 aiptek->curSetting.programmableDelay); in aiptek_probe()
1862 /* Murphy says that some day someone will have a tablet that fails the in aiptek_probe()
1865 dev_info(&intf->dev, in aiptek_probe()
1867 err = -EINVAL; in aiptek_probe()
1877 err = sysfs_create_group(&intf->dev.kobj, &aiptek_attribute_group); in aiptek_probe()
1879 dev_warn(&intf->dev, "cannot create sysfs group err: %d\n", in aiptek_probe()
1884 /* Register the tablet as an Input Device in aiptek_probe()
1886 err = input_register_device(aiptek->inputdev); in aiptek_probe()
1888 dev_warn(&intf->dev, in aiptek_probe()
1894 fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group); in aiptek_probe()
1895 fail3: usb_free_urb(aiptek->urb); in aiptek_probe()
1896 fail2: usb_free_coherent(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data, in aiptek_probe()
1897 aiptek->data_dma); in aiptek_probe()
1905 * Deal with tablet disconnecting from the system.
1917 usb_kill_urb(aiptek->urb); in aiptek_disconnect()
1918 input_unregister_device(aiptek->inputdev); in aiptek_disconnect()
1919 sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group); in aiptek_disconnect()
1920 usb_free_urb(aiptek->urb); in aiptek_disconnect()
1923 aiptek->data, aiptek->data_dma); in aiptek_disconnect()
1938 MODULE_DESCRIPTION("Aiptek HyperPen USB Tablet Driver");
1942 MODULE_PARM_DESC(programmableDelay, "delay used during tablet programming");