This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Zappacky

By: a guest on Apr 11th, 2008  |  syntax: None  |  size: 5.07 KB  |  views: 83  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -uNr vanilla/src/2.6.19/wacom.h mine/src/2.6.19/wacom.h
  2. --- vanilla/src/2.6.19/wacom.h  2008-03-31 17:53:15.000000000 -0400
  3. +++ mine/src/2.6.19/wacom.h     2008-04-09 21:27:54.000000000 -0400
  4.  -125,6 +125,7 @@
  5.  extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
  6.  extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
  7.  extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
  8. +extern void input_dev_tpc(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
  9.  extern __u16 wacom_le16_to_cpu(unsigned char *data);
  10.  extern __u16 wacom_be16_to_cpu(unsigned char *data);
  11.  extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id);
  12. diff -uNr vanilla/src/2.6.19/wacom_wac.c mine/src/2.6.19/wacom_wac.c
  13. --- vanilla/src/2.6.19/wacom_wac.c      2008-03-31 17:53:15.000000000 -0400
  14. +++ mine/src/2.6.19/wacom_wac.c 2008-04-10 18:22:05.000000000 -0400
  15.  -536,6 +536,41 @@
  16.         return 1;
  17.  }
  18.  
  19. +int wacom_tpc_irq (struct wacom_wac *wacom_wac, void *wcombo)
  20. +{
  21. +       char *data = wacom_wac->data;
  22. +       struct wacom_combo *combo = wcombo;
  23. +       struct urb *urb = combo->urb;
  24. +       if (urb->actual_length == 5) {
  25. +               /* Finger event, ignore for now.
  26. +               int absx = ((data[2] << 8) & 0xff00) + (data[1] & 0xff);
  27. +               int absy = ((data[4] << 8) & 0xff00) + (data[3] & 0xff);
  28. +               */
  29. +       } else {
  30. +               int absx = ((data[3] << 8) & 0xff00) + (data[2] & 0xff);
  31. +               int absy = ((data[5] << 8) & 0xff00) + (data[4] & 0xff);
  32. +               int absp = ((data[7] << 8) & 0x0100) + (data[6] & 0xff);
  33. +              
  34. +               if (data[1] & 0x8) {
  35. +                       wacom_report_abs (wcombo, ABS_MISC, ERASER_DEVICE_ID);
  36. +                       wacom_report_key (wcombo, BTN_TOOL_RUBBER, (data[1] & 0x20));
  37. +                       wacom_report_key (wcombo, BTN_TOUCH, (data[1] & 0x4));
  38. +               } else {
  39. +                       wacom_report_key (wcombo, ABS_MISC, STYLUS_DEVICE_ID);
  40. +                       wacom_report_key (wcombo, BTN_TOOL_PEN, (data[1] & 0x20));
  41. +                       wacom_report_key (wcombo, BTN_TOUCH, (data[1] & 0x1));
  42. +               }
  43. +              
  44. +               wacom_report_key (wcombo, BTN_STYLUS, data[1] & 0x2);
  45. +               wacom_report_key (wcombo, BTN_STYLUS2, data[1] & 0x10);
  46. +               wacom_report_abs (wcombo, ABS_X, absx);
  47. +               wacom_report_abs (wcombo, ABS_Y, absy);
  48. +               wacom_report_abs (wcombo, ABS_PRESSURE, absp);
  49. +               wacom_input_sync (wcombo);
  50. +       }
  51. +       return 0;
  52. +}
  53. +
  54.  int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
  55.  {
  56.         switch (wacom_wac->features->type) {
  57.  -561,6 +596,9 @@
  58.                 case WACOM_BEE:
  59.                         return (wacom_intuos_irq(wacom_wac, wcombo));
  60.                         break;
  61. +               case TABLETPC:
  62. +                       return (wacom_tpc_irq(wacom_wac, wcombo));
  63. +                       break;
  64.                 default:
  65.                         return 0;
  66.         }
  67.  -597,6 +635,9 @@
  68.                 case PENPARTNER:
  69.                         input_dev_pt(input_dev, wacom_wac);
  70.                         break;
  71. +               case TABLETPC:
  72. +                       input_dev_tpc(input_dev, wacom_wac);
  73. +                       break;
  74.         }
  75.         return;
  76.  }
  77.  -652,6 +693,8 @@
  78.         { "Wacom Cintiq 20WSX",  10, 86680, 54180, 1023, 63, WACOM_BEE },
  79.         { "Wacom Cintiq 12WX",   10, 53020, 33440, 1023, 63, WACOM_BEE },
  80.         { "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 31, INTUOS },
  81. +       { "Wacom ISDv4 USB",      8, 26202, 16325, 1023, 31, TABLETPC },
  82. +       { "Wacom ISDv4 USB",      8, 26202, 16325, 1023, 31, TABLETPC },
  83.         { }
  84.  };
  85.  
  86.  -706,6 +749,8 @@
  87.         { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
  88.         { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
  89.         { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
  90. +       { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x90) },
  91. +       { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x93) },
  92.         { }
  93.  };
  94.  
  95. diff -uNr vanilla/src/2.6.22/wacom_wac.h mine/src/2.6.22/wacom_wac.h
  96. --- vanilla/src/2.6.22/wacom_wac.h      2008-03-31 17:53:15.000000000 -0400
  97. +++ mine/src/2.6.22/wacom_wac.h 2008-04-09 21:28:28.000000000 -0400
  98.  -27,6 +27,7 @@
  99.         CINTIQ,
  100.         WACOM_BEE,
  101.         WACOM_MO,
  102. +       TABLETPC,
  103.         MAX_TYPE
  104.  };
  105.  
  106. diff -uNr vanilla/src/2.6.24/wacom_sys.c mine/src/2.6.24/wacom_sys.c
  107. --- vanilla/src/2.6.24/wacom_sys.c      2008-03-31 17:53:15.000000000 -0400
  108. +++ mine/src/2.6.24/wacom_sys.c 2008-04-10 18:03:55.000000000 -0400
  109.  -219,6 +219,12 @@
  110.         input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER);
  111.  }
  112.  
  113. +void
  114. +input_dev_tpc (struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  115. +{
  116. +
  117. +}
  118. +
  119.  static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
  120.  {
  121.         struct usb_device *dev = interface_to_usbdev(intf);
  122.  -286,12 +292,17 @@
  123.                 goto fail3;
  124.  
  125.         /* Ask the tablet to report tablet data. Repeat until it succeeds */
  126. -       do {
  127. -               rep_data[0] = rep_data[1] = 2;
  128. -               if(usb_set_report(intf, 3, 2, rep_data, 2) >= 0)
  129. -                       error = usb_get_report(intf, 3, 2, rep_data, 2);
  130. -       } while ((error <= 0 || rep_data[1] != 2) && limit++ < 5);
  131. -
  132. +       if (wacom_wac->features->type == TABLETPC) { /* USB ISDv4 (TabletPC) doesn't support SetReport */
  133. +               usb_get_report(intf, 3, 2, rep_data, 2);
  134. +               if (rep_data[0] != 2 || rep_data[1] != 0)
  135. +                       info("Got bad report from TabletPC, may not work properly");
  136. +       } else {
  137. +               do {
  138. +                       rep_data[0] = rep_data[1] = 2;
  139. +                       if(usb_set_report(intf, 3, 2, rep_data, 2) >= 0)
  140. +                               error = usb_get_report(intf, 3, 2, rep_data, 2);
  141. +               } while ((error <= 0 || rep_data[1] != 2) && limit++ < 5);
  142. +       }
  143.         usb_set_intfdata(intf, wacom);
  144.         return 0;
clone this paste RAW Paste Data