Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: wacom - add support for new USB Tablet PCs
Input: replace spin_lock_bh with spin_lock_irqsave in ml_ff_playback
Input: i8042 - add Compal Hel80 laptop to nomux blacklist
Input: cm109 - add keymap for ATCom AU-100 phone
Input: fix the example of an input device driver
Input: psmouse - fix incorrect validate_byte check in OLPC protocol
Input: atkbd - cancel delayed work before freeing its structure
Input: atkbd - add keymap quirk for Inventec Symphony systems
Input: i8042 - add Dell XPS M1530 to nomux list
Input: elo - fix format string in elo driver

+436 -54
+2 -1
Documentation/input/input-programming.txt
··· 20 20 21 21 static struct input_dev *button_dev; 22 22 23 - static void button_interrupt(int irq, void *dummy, struct pt_regs *fp) 23 + static irqreturn_t button_interrupt(int irq, void *dummy) 24 24 { 25 25 input_report_key(button_dev, BTN_0, inb(BUTTON_PORT) & 1); 26 26 input_sync(button_dev); 27 + return IRQ_HANDLED; 27 28 } 28 29 29 30 static int __init button_init(void)
+26 -1
drivers/input/keyboard/atkbd.c
··· 824 824 atkbd_disable(atkbd); 825 825 826 826 /* make sure we don't have a command in flight */ 827 - flush_scheduled_work(); 827 + cancel_delayed_work_sync(&atkbd->event_work); 828 828 829 829 sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); 830 830 input_unregister_device(atkbd->dev); ··· 865 865 for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++) 866 866 __set_bit(forced_release_keys[i], 867 867 atkbd->force_release_mask); 868 + } 869 + 870 + /* 871 + * Inventec system with broken key release on volume keys 872 + */ 873 + static void atkbd_inventec_keymap_fixup(struct atkbd *atkbd) 874 + { 875 + const unsigned int forced_release_keys[] = { 876 + 0xae, 0xb0, 877 + }; 878 + int i; 879 + 880 + if (atkbd->set == 2) 881 + for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++) 882 + __set_bit(forced_release_keys[i], 883 + atkbd->force_release_mask); 868 884 } 869 885 870 886 /* ··· 1483 1467 }, 1484 1468 .callback = atkbd_setup_fixup, 1485 1469 .driver_data = atkbd_hp_keymap_fixup, 1470 + }, 1471 + { 1472 + .ident = "Inventec Symphony", 1473 + .matches = { 1474 + DMI_MATCH(DMI_SYS_VENDOR, "INVENTEC"), 1475 + DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"), 1476 + }, 1477 + .callback = atkbd_setup_fixup, 1478 + .driver_data = atkbd_inventec_keymap_fixup, 1486 1479 }, 1487 1480 { } 1488 1481 };
+36 -1
drivers/input/misc/cm109.c
··· 42 42 43 43 static char *phone = "kip1000"; 44 44 module_param(phone, charp, S_IRUSR); 45 - MODULE_PARM_DESC(phone, "Phone name {kip1000, gtalk, usbph01}"); 45 + MODULE_PARM_DESC(phone, "Phone name {kip1000, gtalk, usbph01, atcom}"); 46 46 47 47 enum { 48 48 /* HID Registers */ ··· 254 254 case 0x28: return KEY_ESC; /* hangup */ 255 255 case 0x48: return KEY_LEFT; /* IN */ 256 256 case 0x88: return KEY_RIGHT; /* OUT */ 257 + default: return special_keymap(scancode); 258 + } 259 + } 260 + 261 + /* 262 + * Keymap for ATCom AU-100 263 + * http://www.atcom.cn/En_products_AU100.html 264 + * http://www.packetizer.com/products/au100/ 265 + * http://www.voip-info.org/wiki/view/AU-100 266 + * 267 + * Contributed by daniel@gimpelevich.san-francisco.ca.us 268 + */ 269 + static unsigned short keymap_atcom(int scancode) 270 + { 271 + switch (scancode) { /* phone key: */ 272 + case 0x82: return KEY_NUMERIC_0; /* 0 */ 273 + case 0x11: return KEY_NUMERIC_1; /* 1 */ 274 + case 0x12: return KEY_NUMERIC_2; /* 2 */ 275 + case 0x14: return KEY_NUMERIC_3; /* 3 */ 276 + case 0x21: return KEY_NUMERIC_4; /* 4 */ 277 + case 0x22: return KEY_NUMERIC_5; /* 5 */ 278 + case 0x24: return KEY_NUMERIC_6; /* 6 */ 279 + case 0x41: return KEY_NUMERIC_7; /* 7 */ 280 + case 0x42: return KEY_NUMERIC_8; /* 8 */ 281 + case 0x44: return KEY_NUMERIC_9; /* 9 */ 282 + case 0x84: return KEY_NUMERIC_POUND; /* # */ 283 + case 0x81: return KEY_NUMERIC_STAR; /* * */ 284 + case 0x18: return KEY_ENTER; /* pickup */ 285 + case 0x28: return KEY_ESC; /* hangup */ 286 + case 0x48: return KEY_LEFT; /* left arrow */ 287 + case 0x88: return KEY_RIGHT; /* right arrow */ 257 288 default: return special_keymap(scancode); 258 289 } 259 290 } ··· 871 840 keymap = keymap_usbph01; 872 841 printk(KERN_INFO KBUILD_MODNAME ": " 873 842 "Keymap for Allied-Telesis Corega USBPH01 phone loaded\n"); 843 + } else if (!strcasecmp(phone, "atcom")) { 844 + keymap = keymap_atcom; 845 + printk(KERN_INFO KBUILD_MODNAME ": " 846 + "Keymap for ATCom AU-100 phone loaded\n"); 874 847 } else { 875 848 printk(KERN_ERR KBUILD_MODNAME ": " 876 849 "Unsupported phone: %s\n", phone);
+1 -1
drivers/input/mouse/hgpk.c
··· 125 125 */ 126 126 static int hgpk_validate_byte(unsigned char *packet) 127 127 { 128 - return (packet[0] & 0x0C) == 0x08; 128 + return (packet[0] & 0x0C) != 0x08; 129 129 } 130 130 131 131 static void hgpk_process_packet(struct psmouse *psmouse)
+14
drivers/input/serio/i8042-x86ia64io.h
··· 337 337 DMI_MATCH(DMI_PRODUCT_NAME, "2656"), 338 338 }, 339 339 }, 340 + { 341 + .ident = "Dell XPS M1530", 342 + .matches = { 343 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 344 + DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"), 345 + }, 346 + }, 347 + { 348 + .ident = "Compal HEL80I", 349 + .matches = { 350 + DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"), 351 + DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"), 352 + }, 353 + }, 340 354 { } 341 355 }; 342 356
+7 -6
drivers/input/tablet/wacom.h
··· 66 66 * - Support Intuos3 4x6 67 67 * v1.47 (pc) - Added support for Bamboo 68 68 * v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX 69 + * v1.49 (pc) - Added support for USB Tablet PC (0x90, 0x93, and 0x9A) 69 70 */ 70 71 71 72 /* ··· 87 86 /* 88 87 * Version Information 89 88 */ 90 - #define DRIVER_VERSION "v1.48" 89 + #define DRIVER_VERSION "v1.49" 91 90 #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" 92 91 #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" 93 92 #define DRIVER_LICENSE "GPL" ··· 104 103 struct usb_device *usbdev; 105 104 struct usb_interface *intf; 106 105 struct urb *irq; 107 - struct wacom_wac * wacom_wac; 106 + struct wacom_wac *wacom_wac; 108 107 struct mutex lock; 109 108 unsigned int open:1; 110 109 char phys[32]; 111 110 }; 112 111 113 112 struct wacom_combo { 114 - struct wacom * wacom; 115 - struct urb * urb; 113 + struct wacom *wacom; 114 + struct urb *urb; 116 115 }; 117 116 118 117 extern int wacom_wac_irq(struct wacom_wac * wacom_wac, void * wcombo); ··· 133 132 extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac); 134 133 extern __u16 wacom_le16_to_cpu(unsigned char *data); 135 134 extern __u16 wacom_be16_to_cpu(unsigned char *data); 136 - extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id); 137 - extern const struct usb_device_id * get_device_table(void); 135 + extern struct wacom_features *get_wacom_feature(const struct usb_device_id *id); 136 + extern const struct usb_device_id *get_device_table(void); 138 137 139 138 #endif
+199 -29
drivers/input/tablet/wacom_sys.c
··· 14 14 #include "wacom.h" 15 15 #include "wacom_wac.h" 16 16 17 + /* defines to get HID report descriptor */ 18 + #define HID_DEVICET_HID (USB_TYPE_CLASS | 0x01) 19 + #define HID_DEVICET_REPORT (USB_TYPE_CLASS | 0x02) 20 + #define HID_USAGE_UNDEFINED 0x00 21 + #define HID_USAGE_PAGE 0x05 22 + #define HID_USAGE_PAGE_DIGITIZER 0x0d 23 + #define HID_USAGE_PAGE_DESKTOP 0x01 24 + #define HID_USAGE 0x09 25 + #define HID_USAGE_X 0x30 26 + #define HID_USAGE_Y 0x31 27 + #define HID_USAGE_X_TILT 0x3d 28 + #define HID_USAGE_Y_TILT 0x3e 29 + #define HID_USAGE_FINGER 0x22 30 + #define HID_USAGE_STYLUS 0x20 31 + #define HID_COLLECTION 0xc0 32 + 33 + enum { 34 + WCM_UNDEFINED = 0, 35 + WCM_DESKTOP, 36 + WCM_DIGITIZER, 37 + }; 38 + 39 + struct hid_descriptor { 40 + struct usb_descriptor_header header; 41 + __le16 bcdHID; 42 + u8 bCountryCode; 43 + u8 bNumDescriptors; 44 + u8 bDescriptorType; 45 + __le16 wDescriptorLength; 46 + } __attribute__ ((packed)); 47 + 48 + /* defines to get/set USB message */ 17 49 #define USB_REQ_GET_REPORT 0x01 18 50 #define USB_REQ_SET_REPORT 0x09 51 + #define WAC_HID_FEATURE_REPORT 0x03 19 52 20 53 static int usb_get_report(struct usb_interface *intf, unsigned char type, 21 54 unsigned char id, void *buf, int size) ··· 113 80 void wacom_report_key(void *wcombo, unsigned int key_type, int key_data) 114 81 { 115 82 input_report_key(get_input_dev((struct wacom_combo *)wcombo), key_type, key_data); 116 - return; 117 83 } 118 84 119 85 void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data) 120 86 { 121 87 input_report_abs(get_input_dev((struct wacom_combo *)wcombo), abs_type, abs_data); 122 - return; 123 88 } 124 89 125 90 void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data) 126 91 { 127 92 input_report_rel(get_input_dev((struct wacom_combo *)wcombo), rel_type, rel_data); 128 - return; 129 93 } 130 94 131 95 void wacom_input_event(void *wcombo, unsigned int type, unsigned int code, int value) 132 96 { 133 97 input_event(get_input_dev((struct wacom_combo *)wcombo), type, code, value); 134 - return; 135 98 } 136 99 137 100 __u16 wacom_be16_to_cpu(unsigned char *data) ··· 147 118 void wacom_input_sync(void *wcombo) 148 119 { 149 120 input_sync(get_input_dev((struct wacom_combo *)wcombo)); 150 - return; 151 121 } 152 122 153 123 static int wacom_open(struct input_dev *dev) ··· 188 160 189 161 void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 190 162 { 191 - input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_1) | 163 + input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_1) | 192 164 BIT_MASK(BTN_5); 193 165 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); 194 166 } ··· 198 170 input_dev->evbit[0] |= BIT_MASK(EV_MSC); 199 171 input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); 200 172 input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); 201 - input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | 173 + input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | 202 174 BIT_MASK(BTN_4); 203 175 } 204 176 ··· 206 178 { 207 179 input_dev->evbit[0] |= BIT_MASK(EV_REL); 208 180 input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); 209 - input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | 181 + input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_LEFT) | 210 182 BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); 211 183 input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | 212 184 BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2); ··· 216 188 void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 217 189 { 218 190 input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); 219 - input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | 191 + input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | 220 192 BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3); 221 193 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); 222 194 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); ··· 224 196 225 197 void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 226 198 { 227 - input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_4) | 199 + input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_4) | 228 200 BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7); 229 201 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); 230 202 } 231 203 232 204 void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 233 205 { 234 - input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9); 206 + input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9); 235 207 } 236 208 237 209 void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) ··· 239 211 input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL); 240 212 input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); 241 213 input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); 242 - input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | 214 + input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_LEFT) | 243 215 BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) | 244 216 BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); 245 217 input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | ··· 256 228 257 229 void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 258 230 { 259 - input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2) | 260 - BIT_MASK(BTN_TOOL_RUBBER); 231 + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2); 261 232 } 262 233 263 234 void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) ··· 264 237 input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER); 265 238 } 266 239 240 + static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc, 241 + struct wacom_wac *wacom_wac) 242 + { 243 + struct usb_device *dev = interface_to_usbdev(intf); 244 + struct wacom_features *features = wacom_wac->features; 245 + char limit = 0, result = 0; 246 + int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; 247 + unsigned char *report; 248 + 249 + report = kzalloc(hid_desc->wDescriptorLength, GFP_KERNEL); 250 + if (!report) 251 + return -ENOMEM; 252 + 253 + /* retrive report descriptors */ 254 + do { 255 + result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 256 + USB_REQ_GET_DESCRIPTOR, 257 + USB_RECIP_INTERFACE | USB_DIR_IN, 258 + HID_DEVICET_REPORT << 8, 259 + intf->altsetting[0].desc.bInterfaceNumber, /* interface */ 260 + report, 261 + hid_desc->wDescriptorLength, 262 + 5000); /* 5 secs */ 263 + } while (result < 0 && limit++ < 5); 264 + 265 + if (result < 0) 266 + goto out; 267 + 268 + for (i = 0; i < hid_desc->wDescriptorLength; i++) { 269 + 270 + switch (report[i]) { 271 + case HID_USAGE_PAGE: 272 + switch (report[i + 1]) { 273 + case HID_USAGE_PAGE_DIGITIZER: 274 + usage = WCM_DIGITIZER; 275 + i++; 276 + break; 277 + 278 + case HID_USAGE_PAGE_DESKTOP: 279 + usage = WCM_DESKTOP; 280 + i++; 281 + break; 282 + } 283 + break; 284 + 285 + case HID_USAGE: 286 + switch (report[i + 1]) { 287 + case HID_USAGE_X: 288 + if (usage == WCM_DESKTOP) { 289 + if (finger) { 290 + features->touch_x_max = 291 + features->touch_y_max = 292 + wacom_le16_to_cpu(&report[i + 3]); 293 + features->x_max = 294 + wacom_le16_to_cpu(&report[i + 6]); 295 + i += 7; 296 + } else if (pen) { 297 + features->x_max = 298 + wacom_le16_to_cpu(&report[i + 3]); 299 + i += 4; 300 + } 301 + } else if (usage == WCM_DIGITIZER) { 302 + /* max pressure isn't reported 303 + features->pressure_max = (unsigned short) 304 + (report[i+4] << 8 | report[i + 3]); 305 + */ 306 + features->pressure_max = 255; 307 + i += 4; 308 + } 309 + break; 310 + 311 + case HID_USAGE_Y: 312 + if (usage == WCM_DESKTOP) 313 + features->y_max = 314 + wacom_le16_to_cpu(&report[i + 3]); 315 + i += 4; 316 + break; 317 + 318 + case HID_USAGE_FINGER: 319 + finger = 1; 320 + i++; 321 + break; 322 + 323 + case HID_USAGE_STYLUS: 324 + pen = 1; 325 + i++; 326 + break; 327 + 328 + case HID_USAGE_UNDEFINED: 329 + if (usage == WCM_DESKTOP && finger) /* capacity */ 330 + features->pressure_max = 331 + wacom_le16_to_cpu(&report[i + 3]); 332 + i += 4; 333 + break; 334 + } 335 + break; 336 + 337 + case HID_COLLECTION: 338 + /* reset UsagePage ans Finger */ 339 + finger = usage = 0; 340 + break; 341 + } 342 + } 343 + 344 + result = 0; 345 + 346 + out: 347 + kfree(report); 348 + return result; 349 + } 350 + 267 351 static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) 268 352 { 269 353 struct usb_device *dev = interface_to_usbdev(intf); 354 + struct usb_host_interface *interface = intf->cur_altsetting; 270 355 struct usb_endpoint_descriptor *endpoint; 271 356 struct wacom *wacom; 272 357 struct wacom_wac *wacom_wac; 358 + struct wacom_features *features; 273 359 struct input_dev *input_dev; 274 360 int error = -ENOMEM; 275 361 char rep_data[2], limit = 0; 362 + struct hid_descriptor *hid_desc; 276 363 277 364 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); 278 365 wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL); ··· 409 268 usb_make_path(dev, wacom->phys, sizeof(wacom->phys)); 410 269 strlcat(wacom->phys, "/input0", sizeof(wacom->phys)); 411 270 412 - wacom_wac->features = get_wacom_feature(id); 413 - BUG_ON(wacom_wac->features->pktlen > 10); 271 + wacom_wac->features = features = get_wacom_feature(id); 272 + BUG_ON(features->pktlen > 10); 414 273 415 274 input_dev->name = wacom_wac->features->name; 416 275 wacom->wacom_wac = wacom_wac; ··· 423 282 input_dev->open = wacom_open; 424 283 input_dev->close = wacom_close; 425 284 285 + endpoint = &intf->cur_altsetting->endpoint[0].desc; 286 + 287 + /* TabletPC need to retrieve the physical and logical maximum from report descriptor */ 288 + if (wacom_wac->features->type == TABLETPC) { 289 + if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { 290 + if (usb_get_extra_descriptor(&interface->endpoint[0], 291 + HID_DEVICET_REPORT, &hid_desc)) { 292 + printk("wacom: can not retrive extra class descriptor\n"); 293 + goto fail2; 294 + } 295 + } 296 + error = wacom_parse_hid(intf, hid_desc, wacom_wac); 297 + if (error) 298 + goto fail2; 299 + } 300 + 426 301 input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 427 302 input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | 428 303 BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS); 429 - input_set_abs_params(input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0); 430 - input_set_abs_params(input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0); 431 - input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0); 304 + input_set_abs_params(input_dev, ABS_X, 0, features->x_max, 4, 0); 305 + input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 4, 0); 306 + input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 0, 0); 307 + if (features->type == TABLETPC) { 308 + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_DOUBLETAP); 309 + input_set_abs_params(input_dev, ABS_RX, 0, features->touch_x_max, 4, 0); 310 + input_set_abs_params(input_dev, ABS_RY, 0, features->touch_y_max, 4, 0); 311 + } 432 312 input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC); 433 313 434 314 wacom_init_input_dev(input_dev, wacom_wac); 435 - 436 - endpoint = &intf->cur_altsetting->endpoint[0].desc; 437 315 438 316 usb_fill_int_urb(wacom->irq, dev, 439 317 usb_rcvintpipe(dev, endpoint->bEndpointAddress), ··· 465 305 if (error) 466 306 goto fail3; 467 307 468 - /* Ask the tablet to report tablet data. Repeat until it succeeds */ 469 - do { 470 - rep_data[0] = 2; 471 - rep_data[1] = 2; 472 - usb_set_report(intf, 3, 2, rep_data, 2); 473 - usb_get_report(intf, 3, 2, rep_data, 2); 474 - } while (rep_data[1] != 2 && limit++ < 5); 308 + /* 309 + * Ask the tablet to report tablet data if it is not a Tablet PC. 310 + * Repeat until it succeeds 311 + */ 312 + if (wacom_wac->features->type != TABLETPC) { 313 + do { 314 + rep_data[0] = 2; 315 + rep_data[1] = 2; 316 + error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, 317 + 2, rep_data, 2); 318 + if (error >= 0) 319 + error = usb_get_report(intf, 320 + WAC_HID_FEATURE_REPORT, 2, 321 + rep_data, 2); 322 + } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); 323 + } 475 324 476 325 usb_set_intfdata(intf, wacom); 477 326 return 0; ··· 502 333 usb_kill_urb(wacom->irq); 503 334 input_unregister_device(wacom->dev); 504 335 usb_free_urb(wacom->irq); 505 - usb_buffer_free(interface_to_usbdev(intf), 10, wacom->wacom_wac->data, wacom->data_dma); 336 + usb_buffer_free(interface_to_usbdev(intf), 10, 337 + wacom->wacom_wac->data, wacom->data_dma); 506 338 kfree(wacom->wacom_wac); 507 339 kfree(wacom); 508 340 }
+146 -14
drivers/input/tablet/wacom_wac.c
··· 535 535 return 1; 536 536 } 537 537 538 + int wacom_tpc_irq(struct wacom_wac *wacom, void *wcombo) 539 + { 540 + char *data = wacom->data; 541 + int prox = 0, pressure; 542 + static int stylusInProx, touchInProx = 1, touchOut; 543 + struct urb *urb = ((struct wacom_combo *)wcombo)->urb; 544 + 545 + dbg("wacom_tpc_irq: received report #%d", data[0]); 546 + 547 + if (urb->actual_length == 5 || data[0] == 6) { /* Touch data */ 548 + if (urb->actual_length == 5) { /* with touch */ 549 + prox = data[0] & 0x03; 550 + } else { /* with capacity */ 551 + prox = data[1] & 0x03; 552 + } 553 + 554 + if (!stylusInProx) { /* stylus not in prox */ 555 + if (prox) { 556 + if (touchInProx) { 557 + wacom->tool[1] = BTN_TOOL_DOUBLETAP; 558 + wacom->id[0] = TOUCH_DEVICE_ID; 559 + if (urb->actual_length != 5) { 560 + wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2])); 561 + wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4])); 562 + wacom_report_abs(wcombo, ABS_PRESSURE, wacom_le16_to_cpu(&data[6])); 563 + wacom_report_key(wcombo, BTN_TOUCH, wacom_le16_to_cpu(&data[6])); 564 + } else { 565 + wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[1])); 566 + wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[3])); 567 + wacom_report_key(wcombo, BTN_TOUCH, 1); 568 + } 569 + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); 570 + wacom_report_key(wcombo, wacom->tool[1], prox & 0x01); 571 + touchOut = 1; 572 + return 1; 573 + } 574 + } else { 575 + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); 576 + wacom_report_key(wcombo, wacom->tool[1], prox & 0x01); 577 + wacom_report_key(wcombo, BTN_TOUCH, 0); 578 + touchOut = 0; 579 + touchInProx = 1; 580 + return 1; 581 + } 582 + } else if (touchOut || !prox) { /* force touch out-prox */ 583 + wacom_report_abs(wcombo, ABS_MISC, TOUCH_DEVICE_ID); 584 + wacom_report_key(wcombo, BTN_TOUCH, 0); 585 + touchOut = 0; 586 + touchInProx = 1; 587 + return 1; 588 + } 589 + } else if (data[0] == 2) { /* Penabled */ 590 + prox = data[1] & 0x20; 591 + 592 + touchInProx = 0; 593 + 594 + wacom->id[0] = ERASER_DEVICE_ID; 595 + 596 + /* 597 + * if going from out of proximity into proximity select between the eraser 598 + * and the pen based on the state of the stylus2 button, choose eraser if 599 + * pressed else choose pen. if not a proximity change from out to in, send 600 + * an out of proximity for previous tool then a in for new tool. 601 + */ 602 + if (prox) { /* in prox */ 603 + if (!wacom->tool[0]) { 604 + /* Going into proximity select tool */ 605 + wacom->tool[1] = (data[1] & 0x08) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; 606 + if (wacom->tool[1] == BTN_TOOL_PEN) 607 + wacom->id[0] = STYLUS_DEVICE_ID; 608 + } else if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[1] & 0x08)) { 609 + /* 610 + * was entered with stylus2 pressed 611 + * report out proximity for previous tool 612 + */ 613 + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); 614 + wacom_report_key(wcombo, wacom->tool[1], 0); 615 + wacom_input_sync(wcombo); 616 + 617 + /* set new tool */ 618 + wacom->tool[1] = BTN_TOOL_PEN; 619 + wacom->id[0] = STYLUS_DEVICE_ID; 620 + return 0; 621 + } 622 + if (wacom->tool[1] != BTN_TOOL_RUBBER) { 623 + /* Unknown tool selected default to pen tool */ 624 + wacom->tool[1] = BTN_TOOL_PEN; 625 + wacom->id[0] = STYLUS_DEVICE_ID; 626 + } 627 + wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02); 628 + wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x10); 629 + wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2])); 630 + wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4])); 631 + pressure = ((data[7] & 0x01) << 8) | data[6]; 632 + if (pressure < 0) 633 + pressure = wacom->features->pressure_max + pressure + 1; 634 + wacom_report_abs(wcombo, ABS_PRESSURE, pressure); 635 + wacom_report_key(wcombo, BTN_TOUCH, pressure); 636 + } else { 637 + wacom_report_abs(wcombo, ABS_PRESSURE, 0); 638 + wacom_report_key(wcombo, BTN_STYLUS, 0); 639 + wacom_report_key(wcombo, BTN_STYLUS2, 0); 640 + wacom_report_key(wcombo, BTN_TOUCH, 0); 641 + } 642 + wacom_report_key(wcombo, wacom->tool[1], prox); 643 + wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); 644 + stylusInProx = prox; 645 + wacom->tool[0] = prox; 646 + return 1; 647 + } 648 + return 0; 649 + } 650 + 538 651 int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo) 539 652 { 540 653 switch (wacom_wac->features->type) { 541 654 case PENPARTNER: 542 - return (wacom_penpartner_irq(wacom_wac, wcombo)); 543 - break; 655 + return wacom_penpartner_irq(wacom_wac, wcombo); 656 + 544 657 case PL: 545 - return (wacom_pl_irq(wacom_wac, wcombo)); 546 - break; 658 + return wacom_pl_irq(wacom_wac, wcombo); 659 + 547 660 case WACOM_G4: 548 661 case GRAPHIRE: 549 662 case WACOM_MO: 550 - return (wacom_graphire_irq(wacom_wac, wcombo)); 551 - break; 663 + return wacom_graphire_irq(wacom_wac, wcombo); 664 + 552 665 case PTU: 553 - return (wacom_ptu_irq(wacom_wac, wcombo)); 554 - break; 666 + return wacom_ptu_irq(wacom_wac, wcombo); 667 + 555 668 case INTUOS: 556 669 case INTUOS3S: 557 670 case INTUOS3: 558 671 case INTUOS3L: 559 672 case CINTIQ: 560 673 case WACOM_BEE: 561 - return (wacom_intuos_irq(wacom_wac, wcombo)); 562 - break; 674 + return wacom_intuos_irq(wacom_wac, wcombo); 675 + 676 + case TABLETPC: 677 + return wacom_tpc_irq(wacom_wac, wcombo); 678 + 563 679 default: 564 680 return 0; 565 681 } ··· 702 586 /* fall through */ 703 587 case INTUOS3S: 704 588 input_dev_i3s(input_dev, wacom_wac); 589 + /* fall through */ 705 590 case INTUOS: 706 591 input_dev_i(input_dev, wacom_wac); 707 592 break; 708 593 case PL: 709 594 case PTU: 595 + case TABLETPC: 710 596 input_dev_pl(input_dev, wacom_wac); 711 - break; 597 + /* fall through */ 712 598 case PENPARTNER: 713 599 input_dev_pt(input_dev, wacom_wac); 714 600 break; ··· 729 611 { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 }, 730 612 { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO }, 731 613 { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO }, 614 + { "Wacom Bamboo1 Medium",8, 16704, 12064, 511, 63, GRAPHIRE }, 732 615 { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE }, 733 616 { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE }, 734 617 { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE }, ··· 769 650 { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ }, 770 651 { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE }, 771 652 { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE }, 653 + { "Wacom DTU1931", 8, 37832, 30305, 511, 0, PL }, 654 + { "Wacom ISDv4 90", 8, 26202, 16325, 255, 0, TABLETPC }, 655 + { "Wacom ISDv4 93", 8, 26202, 16325, 255, 0, TABLETPC }, 656 + { "Wacom ISDv4 9A", 8, 26202, 16325, 255, 0, TABLETPC }, 772 657 { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, 773 658 { } 774 659 }; ··· 788 665 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) }, 789 666 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) }, 790 667 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) }, 668 + { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x19) }, 791 669 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, 792 670 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) }, 793 671 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, ··· 828 704 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, 829 705 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) }, 830 706 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) }, 707 + { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC7) }, 708 + { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x90) }, 709 + { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x93) }, 710 + { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x9A) }, 831 711 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, 832 712 { } 833 713 }; 834 714 835 - const struct usb_device_id * get_device_table(void) { 836 - const struct usb_device_id * id_table = wacom_ids; 715 + const struct usb_device_id *get_device_table(void) 716 + { 717 + const struct usb_device_id *id_table = wacom_ids; 718 + 837 719 return id_table; 838 720 } 839 721 840 - struct wacom_features * get_wacom_feature(const struct usb_device_id * id) { 722 + struct wacom_features * get_wacom_feature(const struct usb_device_id *id) 723 + { 841 724 int index = id - wacom_ids; 842 725 struct wacom_features *wf = &wacom_features[index]; 726 + 843 727 return wf; 844 728 } 845 729
+4
drivers/input/tablet/wacom_wac.h
··· 10 10 #define WACOM_WAC_H 11 11 12 12 #define STYLUS_DEVICE_ID 0x02 13 + #define TOUCH_DEVICE_ID 0x03 13 14 #define CURSOR_DEVICE_ID 0x06 14 15 #define ERASER_DEVICE_ID 0x0A 15 16 #define PAD_DEVICE_ID 0x0F ··· 28 27 CINTIQ, 29 28 WACOM_BEE, 30 29 WACOM_MO, 30 + TABLETPC, 31 31 MAX_TYPE 32 32 }; 33 33 ··· 40 38 int pressure_max; 41 39 int distance_max; 42 40 int type; 41 + int touch_x_max; 42 + int touch_y_max; 43 43 }; 44 44 45 45 struct wacom_wac {
+1 -1
drivers/input/touchscreen/elo.c
··· 262 262 input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); 263 263 264 264 printk(KERN_INFO "elo: %sTouch touchscreen, fw: %02x.%02x, " 265 - "features: %x02x, controller: 0x%02x\n", 265 + "features: 0x%02x, controller: 0x%02x\n", 266 266 elo_types[(packet[1] -'0') & 0x03], 267 267 packet[5], packet[4], packet[3], packet[7]); 268 268