diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-08 07:52:00 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-08 07:52:00 -0500 |
commit | 4d117c5c6b00254e51c61ff5b506ccaba21a5a03 (patch) | |
tree | ecb9d3ee4bfd9610c459c1eb0c0357c2905f3ae4 /drivers/input | |
parent | 6c415b9234a8c71f290e5d4fddc467f103f32719 (diff) | |
parent | 43714539eab42b2fa3653ea7bd667b36c2291b11 (diff) |
Merge branch 'sched/urgent' into sched/core
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/ff-memless.c | 5 | ||||
-rw-r--r-- | drivers/input/keyboard/atkbd.c | 27 | ||||
-rw-r--r-- | drivers/input/misc/cm109.c | 37 | ||||
-rw-r--r-- | drivers/input/mouse/hgpk.c | 2 | ||||
-rw-r--r-- | drivers/input/serio/i8042-x86ia64io.h | 14 | ||||
-rw-r--r-- | drivers/input/tablet/wacom.h | 13 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 228 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 160 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.h | 4 | ||||
-rw-r--r-- | drivers/input/touchscreen/elo.c | 2 | ||||
-rw-r--r-- | drivers/input/xen-kbdfront.c | 6 |
11 files changed, 440 insertions, 58 deletions
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index 6790e975a98c..bc4e40f3ede7 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c | |||
@@ -397,8 +397,9 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value) | |||
397 | { | 397 | { |
398 | struct ml_device *ml = dev->ff->private; | 398 | struct ml_device *ml = dev->ff->private; |
399 | struct ml_effect_state *state = &ml->states[effect_id]; | 399 | struct ml_effect_state *state = &ml->states[effect_id]; |
400 | unsigned long flags; | ||
400 | 401 | ||
401 | spin_lock_bh(&ml->timer_lock); | 402 | spin_lock_irqsave(&ml->timer_lock, flags); |
402 | 403 | ||
403 | if (value > 0) { | 404 | if (value > 0) { |
404 | debug("initiated play"); | 405 | debug("initiated play"); |
@@ -424,7 +425,7 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value) | |||
424 | ml_play_effects(ml); | 425 | ml_play_effects(ml); |
425 | } | 426 | } |
426 | 427 | ||
427 | spin_unlock_bh(&ml->timer_lock); | 428 | spin_unlock_irqrestore(&ml->timer_lock, flags); |
428 | 429 | ||
429 | return 0; | 430 | return 0; |
430 | } | 431 | } |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 22016ca15351..379b7ff354ec 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -824,7 +824,7 @@ static void atkbd_disconnect(struct serio *serio) | |||
824 | atkbd_disable(atkbd); | 824 | atkbd_disable(atkbd); |
825 | 825 | ||
826 | /* make sure we don't have a command in flight */ | 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 | sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); | 829 | sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); |
830 | input_unregister_device(atkbd->dev); | 830 | input_unregister_device(atkbd->dev); |
@@ -868,6 +868,22 @@ static void atkbd_hp_keymap_fixup(struct atkbd *atkbd) | |||
868 | } | 868 | } |
869 | 869 | ||
870 | /* | 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); | ||
884 | } | ||
885 | |||
886 | /* | ||
871 | * atkbd_set_keycode_table() initializes keyboard's keycode table | 887 | * atkbd_set_keycode_table() initializes keyboard's keycode table |
872 | * according to the selected scancode set | 888 | * according to the selected scancode set |
873 | */ | 889 | */ |
@@ -1468,6 +1484,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1468 | .callback = atkbd_setup_fixup, | 1484 | .callback = atkbd_setup_fixup, |
1469 | .driver_data = atkbd_hp_keymap_fixup, | 1485 | .driver_data = atkbd_hp_keymap_fixup, |
1470 | }, | 1486 | }, |
1487 | { | ||
1488 | .ident = "Inventec Symphony", | ||
1489 | .matches = { | ||
1490 | DMI_MATCH(DMI_SYS_VENDOR, "INVENTEC"), | ||
1491 | DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"), | ||
1492 | }, | ||
1493 | .callback = atkbd_setup_fixup, | ||
1494 | .driver_data = atkbd_inventec_keymap_fixup, | ||
1495 | }, | ||
1471 | { } | 1496 | { } |
1472 | }; | 1497 | }; |
1473 | 1498 | ||
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index bce160f4349b..86457feccfc4 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c | |||
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | static char *phone = "kip1000"; | 43 | static char *phone = "kip1000"; |
44 | module_param(phone, charp, S_IRUSR); | 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 | enum { | 47 | enum { |
48 | /* HID Registers */ | 48 | /* HID Registers */ |
@@ -258,6 +258,37 @@ static unsigned short keymap_usbph01(int scancode) | |||
258 | } | 258 | } |
259 | } | 259 | } |
260 | 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 */ | ||
288 | default: return special_keymap(scancode); | ||
289 | } | ||
290 | } | ||
291 | |||
261 | static unsigned short (*keymap)(int) = keymap_kip1000; | 292 | static unsigned short (*keymap)(int) = keymap_kip1000; |
262 | 293 | ||
263 | /* | 294 | /* |
@@ -840,6 +871,10 @@ static int __init cm109_select_keymap(void) | |||
840 | keymap = keymap_usbph01; | 871 | keymap = keymap_usbph01; |
841 | printk(KERN_INFO KBUILD_MODNAME ": " | 872 | printk(KERN_INFO KBUILD_MODNAME ": " |
842 | "Keymap for Allied-Telesis Corega USBPH01 phone loaded\n"); | 873 | "Keymap for Allied-Telesis Corega USBPH01 phone loaded\n"); |
874 | } else if (!strcasecmp(phone, "atcom")) { | ||
875 | keymap = keymap_atcom; | ||
876 | printk(KERN_INFO KBUILD_MODNAME ": " | ||
877 | "Keymap for ATCom AU-100 phone loaded\n"); | ||
843 | } else { | 878 | } else { |
844 | printk(KERN_ERR KBUILD_MODNAME ": " | 879 | printk(KERN_ERR KBUILD_MODNAME ": " |
845 | "Unsupported phone: %s\n", phone); | 880 | "Unsupported phone: %s\n", phone); |
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c index e82d34201e97..88f04bf2ad6c 100644 --- a/drivers/input/mouse/hgpk.c +++ b/drivers/input/mouse/hgpk.c | |||
@@ -125,7 +125,7 @@ static void hgpk_spewing_hack(struct psmouse *psmouse, | |||
125 | */ | 125 | */ |
126 | static int hgpk_validate_byte(unsigned char *packet) | 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 | static void hgpk_process_packet(struct psmouse *psmouse) | 131 | static void hgpk_process_packet(struct psmouse *psmouse) |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index eec375cd10e6..29e686388a2c 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -337,6 +337,20 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { | |||
337 | DMI_MATCH(DMI_PRODUCT_NAME, "2656"), | 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 | ||
diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h index ca62ec639f8f..677680e9f54f 100644 --- a/drivers/input/tablet/wacom.h +++ b/drivers/input/tablet/wacom.h | |||
@@ -66,6 +66,7 @@ | |||
66 | * - Support Intuos3 4x6 | 66 | * - Support Intuos3 4x6 |
67 | * v1.47 (pc) - Added support for Bamboo | 67 | * v1.47 (pc) - Added support for Bamboo |
68 | * v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX | 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 | /* |
@@ -86,7 +87,7 @@ | |||
86 | /* | 87 | /* |
87 | * Version Information | 88 | * Version Information |
88 | */ | 89 | */ |
89 | #define DRIVER_VERSION "v1.48" | 90 | #define DRIVER_VERSION "v1.49" |
90 | #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" | 91 | #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" |
91 | #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" | 92 | #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" |
92 | #define DRIVER_LICENSE "GPL" | 93 | #define DRIVER_LICENSE "GPL" |
@@ -103,15 +104,15 @@ struct wacom { | |||
103 | struct usb_device *usbdev; | 104 | struct usb_device *usbdev; |
104 | struct usb_interface *intf; | 105 | struct usb_interface *intf; |
105 | struct urb *irq; | 106 | struct urb *irq; |
106 | struct wacom_wac * wacom_wac; | 107 | struct wacom_wac *wacom_wac; |
107 | struct mutex lock; | 108 | struct mutex lock; |
108 | unsigned int open:1; | 109 | unsigned int open:1; |
109 | char phys[32]; | 110 | char phys[32]; |
110 | }; | 111 | }; |
111 | 112 | ||
112 | struct wacom_combo { | 113 | struct wacom_combo { |
113 | struct wacom * wacom; | 114 | struct wacom *wacom; |
114 | struct urb * urb; | 115 | struct urb *urb; |
115 | }; | 116 | }; |
116 | 117 | ||
117 | extern int wacom_wac_irq(struct wacom_wac * wacom_wac, void * wcombo); | 118 | extern int wacom_wac_irq(struct wacom_wac * wacom_wac, void * wcombo); |
@@ -132,7 +133,7 @@ extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wa | |||
132 | extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac); | 133 | extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac); |
133 | extern __u16 wacom_le16_to_cpu(unsigned char *data); | 134 | extern __u16 wacom_le16_to_cpu(unsigned char *data); |
134 | extern __u16 wacom_be16_to_cpu(unsigned char *data); | 135 | extern __u16 wacom_be16_to_cpu(unsigned char *data); |
135 | extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id); | 136 | extern struct wacom_features *get_wacom_feature(const struct usb_device_id *id); |
136 | extern const struct usb_device_id * get_device_table(void); | 137 | extern const struct usb_device_id *get_device_table(void); |
137 | 138 | ||
138 | #endif | 139 | #endif |
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 09e227aa0d49..484496daa0f3 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -14,8 +14,41 @@ | |||
14 | #include "wacom.h" | 14 | #include "wacom.h" |
15 | #include "wacom_wac.h" | 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 | #define USB_REQ_GET_REPORT 0x01 | 49 | #define USB_REQ_GET_REPORT 0x01 |
18 | #define USB_REQ_SET_REPORT 0x09 | 50 | #define USB_REQ_SET_REPORT 0x09 |
51 | #define WAC_HID_FEATURE_REPORT 0x03 | ||
19 | 52 | ||
20 | static int usb_get_report(struct usb_interface *intf, unsigned char type, | 53 | static int usb_get_report(struct usb_interface *intf, unsigned char type, |
21 | unsigned char id, void *buf, int size) | 54 | unsigned char id, void *buf, int size) |
@@ -80,25 +113,21 @@ static void wacom_sys_irq(struct urb *urb) | |||
80 | void wacom_report_key(void *wcombo, unsigned int key_type, int key_data) | 113 | void wacom_report_key(void *wcombo, unsigned int key_type, int key_data) |
81 | { | 114 | { |
82 | input_report_key(get_input_dev((struct wacom_combo *)wcombo), key_type, key_data); | 115 | input_report_key(get_input_dev((struct wacom_combo *)wcombo), key_type, key_data); |
83 | return; | ||
84 | } | 116 | } |
85 | 117 | ||
86 | void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data) | 118 | void wacom_report_abs(void *wcombo, unsigned int abs_type, int abs_data) |
87 | { | 119 | { |
88 | input_report_abs(get_input_dev((struct wacom_combo *)wcombo), abs_type, abs_data); | 120 | input_report_abs(get_input_dev((struct wacom_combo *)wcombo), abs_type, abs_data); |
89 | return; | ||
90 | } | 121 | } |
91 | 122 | ||
92 | void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data) | 123 | void wacom_report_rel(void *wcombo, unsigned int rel_type, int rel_data) |
93 | { | 124 | { |
94 | input_report_rel(get_input_dev((struct wacom_combo *)wcombo), rel_type, rel_data); | 125 | input_report_rel(get_input_dev((struct wacom_combo *)wcombo), rel_type, rel_data); |
95 | return; | ||
96 | } | 126 | } |
97 | 127 | ||
98 | void wacom_input_event(void *wcombo, unsigned int type, unsigned int code, int value) | 128 | void wacom_input_event(void *wcombo, unsigned int type, unsigned int code, int value) |
99 | { | 129 | { |
100 | input_event(get_input_dev((struct wacom_combo *)wcombo), type, code, value); | 130 | input_event(get_input_dev((struct wacom_combo *)wcombo), type, code, value); |
101 | return; | ||
102 | } | 131 | } |
103 | 132 | ||
104 | __u16 wacom_be16_to_cpu(unsigned char *data) | 133 | __u16 wacom_be16_to_cpu(unsigned char *data) |
@@ -118,7 +147,6 @@ __u16 wacom_le16_to_cpu(unsigned char *data) | |||
118 | void wacom_input_sync(void *wcombo) | 147 | void wacom_input_sync(void *wcombo) |
119 | { | 148 | { |
120 | input_sync(get_input_dev((struct wacom_combo *)wcombo)); | 149 | input_sync(get_input_dev((struct wacom_combo *)wcombo)); |
121 | return; | ||
122 | } | 150 | } |
123 | 151 | ||
124 | static int wacom_open(struct input_dev *dev) | 152 | static int wacom_open(struct input_dev *dev) |
@@ -160,7 +188,7 @@ static void wacom_close(struct input_dev *dev) | |||
160 | 188 | ||
161 | void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 189 | void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
162 | { | 190 | { |
163 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_1) | | 191 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_1) | |
164 | BIT_MASK(BTN_5); | 192 | BIT_MASK(BTN_5); |
165 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); | 193 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
166 | } | 194 | } |
@@ -170,7 +198,7 @@ void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
170 | input_dev->evbit[0] |= BIT_MASK(EV_MSC); | 198 | input_dev->evbit[0] |= BIT_MASK(EV_MSC); |
171 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); | 199 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); |
172 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); | 200 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); |
173 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | | 201 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | |
174 | BIT_MASK(BTN_4); | 202 | BIT_MASK(BTN_4); |
175 | } | 203 | } |
176 | 204 | ||
@@ -178,7 +206,7 @@ void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
178 | { | 206 | { |
179 | input_dev->evbit[0] |= BIT_MASK(EV_REL); | 207 | input_dev->evbit[0] |= BIT_MASK(EV_REL); |
180 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); | 208 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); |
181 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | | 209 | input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_LEFT) | |
182 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); | 210 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); |
183 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | | 211 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | |
184 | BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2); | 212 | BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2); |
@@ -188,7 +216,7 @@ void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
188 | void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 216 | void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
189 | { | 217 | { |
190 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); | 218 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); |
191 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | | 219 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) | |
192 | BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3); | 220 | BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3); |
193 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); | 221 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); |
194 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | 222 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
@@ -196,14 +224,14 @@ void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
196 | 224 | ||
197 | void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 225 | void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
198 | { | 226 | { |
199 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_4) | | 227 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_4) | |
200 | BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7); | 228 | BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7); |
201 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); | 229 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); |
202 | } | 230 | } |
203 | 231 | ||
204 | void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 232 | void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
205 | { | 233 | { |
206 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9); | 234 | input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9); |
207 | } | 235 | } |
208 | 236 | ||
209 | void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 237 | void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
@@ -211,7 +239,7 @@ void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
211 | input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL); | 239 | input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL); |
212 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); | 240 | input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); |
213 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); | 241 | input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); |
214 | input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | | 242 | input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_LEFT) | |
215 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) | | 243 | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) | |
216 | BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); | 244 | BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); |
217 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | | 245 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | |
@@ -228,8 +256,7 @@ void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
228 | 256 | ||
229 | void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 257 | void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
230 | { | 258 | { |
231 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2) | | 259 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2); |
232 | BIT_MASK(BTN_TOOL_RUBBER); | ||
233 | } | 260 | } |
234 | 261 | ||
235 | void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | 262 | void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) |
@@ -237,15 +264,129 @@ void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) | |||
237 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER); | 264 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER); |
238 | } | 265 | } |
239 | 266 | ||
267 | static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc, | ||
268 | struct wacom_wac *wacom_wac) | ||
269 | { | ||
270 | struct usb_device *dev = interface_to_usbdev(intf); | ||
271 | struct wacom_features *features = wacom_wac->features; | ||
272 | char limit = 0, result = 0; | ||
273 | int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; | ||
274 | unsigned char *report; | ||
275 | |||
276 | report = kzalloc(hid_desc->wDescriptorLength, GFP_KERNEL); | ||
277 | if (!report) | ||
278 | return -ENOMEM; | ||
279 | |||
280 | /* retrive report descriptors */ | ||
281 | do { | ||
282 | result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), | ||
283 | USB_REQ_GET_DESCRIPTOR, | ||
284 | USB_RECIP_INTERFACE | USB_DIR_IN, | ||
285 | HID_DEVICET_REPORT << 8, | ||
286 | intf->altsetting[0].desc.bInterfaceNumber, /* interface */ | ||
287 | report, | ||
288 | hid_desc->wDescriptorLength, | ||
289 | 5000); /* 5 secs */ | ||
290 | } while (result < 0 && limit++ < 5); | ||
291 | |||
292 | if (result < 0) | ||
293 | goto out; | ||
294 | |||
295 | for (i = 0; i < hid_desc->wDescriptorLength; i++) { | ||
296 | |||
297 | switch (report[i]) { | ||
298 | case HID_USAGE_PAGE: | ||
299 | switch (report[i + 1]) { | ||
300 | case HID_USAGE_PAGE_DIGITIZER: | ||
301 | usage = WCM_DIGITIZER; | ||
302 | i++; | ||
303 | break; | ||
304 | |||
305 | case HID_USAGE_PAGE_DESKTOP: | ||
306 | usage = WCM_DESKTOP; | ||
307 | i++; | ||
308 | break; | ||
309 | } | ||
310 | break; | ||
311 | |||
312 | case HID_USAGE: | ||
313 | switch (report[i + 1]) { | ||
314 | case HID_USAGE_X: | ||
315 | if (usage == WCM_DESKTOP) { | ||
316 | if (finger) { | ||
317 | features->touch_x_max = | ||
318 | features->touch_y_max = | ||
319 | wacom_le16_to_cpu(&report[i + 3]); | ||
320 | features->x_max = | ||
321 | wacom_le16_to_cpu(&report[i + 6]); | ||
322 | i += 7; | ||
323 | } else if (pen) { | ||
324 | features->x_max = | ||
325 | wacom_le16_to_cpu(&report[i + 3]); | ||
326 | i += 4; | ||
327 | } | ||
328 | } else if (usage == WCM_DIGITIZER) { | ||
329 | /* max pressure isn't reported | ||
330 | features->pressure_max = (unsigned short) | ||
331 | (report[i+4] << 8 | report[i + 3]); | ||
332 | */ | ||
333 | features->pressure_max = 255; | ||
334 | i += 4; | ||
335 | } | ||
336 | break; | ||
337 | |||
338 | case HID_USAGE_Y: | ||
339 | if (usage == WCM_DESKTOP) | ||
340 | features->y_max = | ||
341 | wacom_le16_to_cpu(&report[i + 3]); | ||
342 | i += 4; | ||
343 | break; | ||
344 | |||
345 | case HID_USAGE_FINGER: | ||
346 | finger = 1; | ||
347 | i++; | ||
348 | break; | ||
349 | |||
350 | case HID_USAGE_STYLUS: | ||
351 | pen = 1; | ||
352 | i++; | ||
353 | break; | ||
354 | |||
355 | case HID_USAGE_UNDEFINED: | ||
356 | if (usage == WCM_DESKTOP && finger) /* capacity */ | ||
357 | features->pressure_max = | ||
358 | wacom_le16_to_cpu(&report[i + 3]); | ||
359 | i += 4; | ||
360 | break; | ||
361 | } | ||
362 | break; | ||
363 | |||
364 | case HID_COLLECTION: | ||
365 | /* reset UsagePage ans Finger */ | ||
366 | finger = usage = 0; | ||
367 | break; | ||
368 | } | ||
369 | } | ||
370 | |||
371 | result = 0; | ||
372 | |||
373 | out: | ||
374 | kfree(report); | ||
375 | return result; | ||
376 | } | ||
377 | |||
240 | static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) | 378 | static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) |
241 | { | 379 | { |
242 | struct usb_device *dev = interface_to_usbdev(intf); | 380 | struct usb_device *dev = interface_to_usbdev(intf); |
381 | struct usb_host_interface *interface = intf->cur_altsetting; | ||
243 | struct usb_endpoint_descriptor *endpoint; | 382 | struct usb_endpoint_descriptor *endpoint; |
244 | struct wacom *wacom; | 383 | struct wacom *wacom; |
245 | struct wacom_wac *wacom_wac; | 384 | struct wacom_wac *wacom_wac; |
385 | struct wacom_features *features; | ||
246 | struct input_dev *input_dev; | 386 | struct input_dev *input_dev; |
247 | int error = -ENOMEM; | 387 | int error = -ENOMEM; |
248 | char rep_data[2], limit = 0; | 388 | char rep_data[2], limit = 0; |
389 | struct hid_descriptor *hid_desc; | ||
249 | 390 | ||
250 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); | 391 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); |
251 | wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL); | 392 | wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL); |
@@ -268,8 +409,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
268 | usb_make_path(dev, wacom->phys, sizeof(wacom->phys)); | 409 | usb_make_path(dev, wacom->phys, sizeof(wacom->phys)); |
269 | strlcat(wacom->phys, "/input0", sizeof(wacom->phys)); | 410 | strlcat(wacom->phys, "/input0", sizeof(wacom->phys)); |
270 | 411 | ||
271 | wacom_wac->features = get_wacom_feature(id); | 412 | wacom_wac->features = features = get_wacom_feature(id); |
272 | BUG_ON(wacom_wac->features->pktlen > 10); | 413 | BUG_ON(features->pktlen > 10); |
273 | 414 | ||
274 | input_dev->name = wacom_wac->features->name; | 415 | input_dev->name = wacom_wac->features->name; |
275 | wacom->wacom_wac = wacom_wac; | 416 | wacom->wacom_wac = wacom_wac; |
@@ -282,18 +423,37 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
282 | input_dev->open = wacom_open; | 423 | input_dev->open = wacom_open; |
283 | input_dev->close = wacom_close; | 424 | input_dev->close = wacom_close; |
284 | 425 | ||
426 | endpoint = &intf->cur_altsetting->endpoint[0].desc; | ||
427 | |||
428 | /* TabletPC need to retrieve the physical and logical maximum from report descriptor */ | ||
429 | if (wacom_wac->features->type == TABLETPC) { | ||
430 | if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { | ||
431 | if (usb_get_extra_descriptor(&interface->endpoint[0], | ||
432 | HID_DEVICET_REPORT, &hid_desc)) { | ||
433 | printk("wacom: can not retrive extra class descriptor\n"); | ||
434 | goto fail2; | ||
435 | } | ||
436 | } | ||
437 | error = wacom_parse_hid(intf, hid_desc, wacom_wac); | ||
438 | if (error) | ||
439 | goto fail2; | ||
440 | } | ||
441 | |||
285 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 442 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
286 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | | 443 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | |
287 | BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS); | 444 | BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS); |
288 | input_set_abs_params(input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0); | 445 | input_set_abs_params(input_dev, ABS_X, 0, features->x_max, 4, 0); |
289 | input_set_abs_params(input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0); | 446 | input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 4, 0); |
290 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0); | 447 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 0, 0); |
448 | if (features->type == TABLETPC) { | ||
449 | input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_DOUBLETAP); | ||
450 | input_set_abs_params(input_dev, ABS_RX, 0, features->touch_x_max, 4, 0); | ||
451 | input_set_abs_params(input_dev, ABS_RY, 0, features->touch_y_max, 4, 0); | ||
452 | } | ||
291 | input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC); | 453 | input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC); |
292 | 454 | ||
293 | wacom_init_input_dev(input_dev, wacom_wac); | 455 | wacom_init_input_dev(input_dev, wacom_wac); |
294 | 456 | ||
295 | endpoint = &intf->cur_altsetting->endpoint[0].desc; | ||
296 | |||
297 | usb_fill_int_urb(wacom->irq, dev, | 457 | usb_fill_int_urb(wacom->irq, dev, |
298 | usb_rcvintpipe(dev, endpoint->bEndpointAddress), | 458 | usb_rcvintpipe(dev, endpoint->bEndpointAddress), |
299 | wacom_wac->data, wacom_wac->features->pktlen, | 459 | wacom_wac->data, wacom_wac->features->pktlen, |
@@ -305,13 +465,22 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
305 | if (error) | 465 | if (error) |
306 | goto fail3; | 466 | goto fail3; |
307 | 467 | ||
308 | /* Ask the tablet to report tablet data. Repeat until it succeeds */ | 468 | /* |
309 | do { | 469 | * Ask the tablet to report tablet data if it is not a Tablet PC. |
310 | rep_data[0] = 2; | 470 | * Repeat until it succeeds |
311 | rep_data[1] = 2; | 471 | */ |
312 | usb_set_report(intf, 3, 2, rep_data, 2); | 472 | if (wacom_wac->features->type != TABLETPC) { |
313 | usb_get_report(intf, 3, 2, rep_data, 2); | 473 | do { |
314 | } while (rep_data[1] != 2 && limit++ < 5); | 474 | rep_data[0] = 2; |
475 | rep_data[1] = 2; | ||
476 | error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, | ||
477 | 2, rep_data, 2); | ||
478 | if (error >= 0) | ||
479 | error = usb_get_report(intf, | ||
480 | WAC_HID_FEATURE_REPORT, 2, | ||
481 | rep_data, 2); | ||
482 | } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); | ||
483 | } | ||
315 | 484 | ||
316 | usb_set_intfdata(intf, wacom); | 485 | usb_set_intfdata(intf, wacom); |
317 | return 0; | 486 | return 0; |
@@ -333,7 +502,8 @@ static void wacom_disconnect(struct usb_interface *intf) | |||
333 | usb_kill_urb(wacom->irq); | 502 | usb_kill_urb(wacom->irq); |
334 | input_unregister_device(wacom->dev); | 503 | input_unregister_device(wacom->dev); |
335 | usb_free_urb(wacom->irq); | 504 | usb_free_urb(wacom->irq); |
336 | usb_buffer_free(interface_to_usbdev(intf), 10, wacom->wacom_wac->data, wacom->data_dma); | 505 | usb_buffer_free(interface_to_usbdev(intf), 10, |
506 | wacom->wacom_wac->data, wacom->data_dma); | ||
337 | kfree(wacom->wacom_wac); | 507 | kfree(wacom->wacom_wac); |
338 | kfree(wacom); | 508 | kfree(wacom); |
339 | } | 509 | } |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index bf3d9a8b2c1b..8dc8d1e59bea 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -535,31 +535,147 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo) | |||
535 | return 1; | 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 | int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo) | 651 | int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo) |
539 | { | 652 | { |
540 | switch (wacom_wac->features->type) { | 653 | switch (wacom_wac->features->type) { |
541 | case PENPARTNER: | 654 | case PENPARTNER: |
542 | return (wacom_penpartner_irq(wacom_wac, wcombo)); | 655 | return wacom_penpartner_irq(wacom_wac, wcombo); |
543 | break; | 656 | |
544 | case PL: | 657 | case PL: |
545 | return (wacom_pl_irq(wacom_wac, wcombo)); | 658 | return wacom_pl_irq(wacom_wac, wcombo); |
546 | break; | 659 | |
547 | case WACOM_G4: | 660 | case WACOM_G4: |
548 | case GRAPHIRE: | 661 | case GRAPHIRE: |
549 | case WACOM_MO: | 662 | case WACOM_MO: |
550 | return (wacom_graphire_irq(wacom_wac, wcombo)); | 663 | return wacom_graphire_irq(wacom_wac, wcombo); |
551 | break; | 664 | |
552 | case PTU: | 665 | case PTU: |
553 | return (wacom_ptu_irq(wacom_wac, wcombo)); | 666 | return wacom_ptu_irq(wacom_wac, wcombo); |
554 | break; | 667 | |
555 | case INTUOS: | 668 | case INTUOS: |
556 | case INTUOS3S: | 669 | case INTUOS3S: |
557 | case INTUOS3: | 670 | case INTUOS3: |
558 | case INTUOS3L: | 671 | case INTUOS3L: |
559 | case CINTIQ: | 672 | case CINTIQ: |
560 | case WACOM_BEE: | 673 | case WACOM_BEE: |
561 | return (wacom_intuos_irq(wacom_wac, wcombo)); | 674 | return wacom_intuos_irq(wacom_wac, wcombo); |
562 | break; | 675 | |
676 | case TABLETPC: | ||
677 | return wacom_tpc_irq(wacom_wac, wcombo); | ||
678 | |||
563 | default: | 679 | default: |
564 | return 0; | 680 | return 0; |
565 | } | 681 | } |
@@ -586,13 +702,15 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w | |||
586 | /* fall through */ | 702 | /* fall through */ |
587 | case INTUOS3S: | 703 | case INTUOS3S: |
588 | input_dev_i3s(input_dev, wacom_wac); | 704 | input_dev_i3s(input_dev, wacom_wac); |
705 | /* fall through */ | ||
589 | case INTUOS: | 706 | case INTUOS: |
590 | input_dev_i(input_dev, wacom_wac); | 707 | input_dev_i(input_dev, wacom_wac); |
591 | break; | 708 | break; |
592 | case PL: | 709 | case PL: |
593 | case PTU: | 710 | case PTU: |
711 | case TABLETPC: | ||
594 | input_dev_pl(input_dev, wacom_wac); | 712 | input_dev_pl(input_dev, wacom_wac); |
595 | break; | 713 | /* fall through */ |
596 | case PENPARTNER: | 714 | case PENPARTNER: |
597 | input_dev_pt(input_dev, wacom_wac); | 715 | input_dev_pt(input_dev, wacom_wac); |
598 | break; | 716 | break; |
@@ -611,6 +729,7 @@ static struct wacom_features wacom_features[] = { | |||
611 | { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 }, | 729 | { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 }, |
612 | { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO }, | 730 | { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO }, |
613 | { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO }, | 731 | { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO }, |
732 | { "Wacom Bamboo1 Medium",8, 16704, 12064, 511, 63, GRAPHIRE }, | ||
614 | { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE }, | 733 | { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE }, |
615 | { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE }, | 734 | { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE }, |
616 | { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE }, | 735 | { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE }, |
@@ -650,6 +769,10 @@ static struct wacom_features wacom_features[] = { | |||
650 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ }, | 769 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ }, |
651 | { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE }, | 770 | { "Wacom Cintiq 20WSX", 10, 86680, 54180, 1023, 63, WACOM_BEE }, |
652 | { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE }, | 771 | { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE }, |
772 | { "Wacom DTU1931", 8, 37832, 30305, 511, 0, PL }, | ||
773 | { "Wacom ISDv4 90", 8, 26202, 16325, 255, 0, TABLETPC }, | ||
774 | { "Wacom ISDv4 93", 8, 26202, 16325, 255, 0, TABLETPC }, | ||
775 | { "Wacom ISDv4 9A", 8, 26202, 16325, 255, 0, TABLETPC }, | ||
653 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, | 776 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, |
654 | { } | 777 | { } |
655 | }; | 778 | }; |
@@ -665,6 +788,7 @@ static struct usb_device_id wacom_ids[] = { | |||
665 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) }, | 788 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) }, |
666 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) }, | 789 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) }, |
667 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) }, | 790 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) }, |
791 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x19) }, | ||
668 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, | 792 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, |
669 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) }, | 793 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) }, |
670 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, | 794 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, |
@@ -704,18 +828,26 @@ static struct usb_device_id wacom_ids[] = { | |||
704 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, | 828 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, |
705 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) }, | 829 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) }, |
706 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) }, | 830 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) }, |
831 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC7) }, | ||
832 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x90) }, | ||
833 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x93) }, | ||
834 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x9A) }, | ||
707 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, | 835 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, |
708 | { } | 836 | { } |
709 | }; | 837 | }; |
710 | 838 | ||
711 | const struct usb_device_id * get_device_table(void) { | 839 | const struct usb_device_id *get_device_table(void) |
712 | const struct usb_device_id * id_table = wacom_ids; | 840 | { |
841 | const struct usb_device_id *id_table = wacom_ids; | ||
842 | |||
713 | return id_table; | 843 | return id_table; |
714 | } | 844 | } |
715 | 845 | ||
716 | struct wacom_features * get_wacom_feature(const struct usb_device_id * id) { | 846 | struct wacom_features * get_wacom_feature(const struct usb_device_id *id) |
847 | { | ||
717 | int index = id - wacom_ids; | 848 | int index = id - wacom_ids; |
718 | struct wacom_features *wf = &wacom_features[index]; | 849 | struct wacom_features *wf = &wacom_features[index]; |
850 | |||
719 | return wf; | 851 | return wf; |
720 | } | 852 | } |
721 | 853 | ||
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 3342bc05847d..f9c8b69673b7 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define WACOM_WAC_H | 10 | #define WACOM_WAC_H |
11 | 11 | ||
12 | #define STYLUS_DEVICE_ID 0x02 | 12 | #define STYLUS_DEVICE_ID 0x02 |
13 | #define TOUCH_DEVICE_ID 0x03 | ||
13 | #define CURSOR_DEVICE_ID 0x06 | 14 | #define CURSOR_DEVICE_ID 0x06 |
14 | #define ERASER_DEVICE_ID 0x0A | 15 | #define ERASER_DEVICE_ID 0x0A |
15 | #define PAD_DEVICE_ID 0x0F | 16 | #define PAD_DEVICE_ID 0x0F |
@@ -27,6 +28,7 @@ enum { | |||
27 | CINTIQ, | 28 | CINTIQ, |
28 | WACOM_BEE, | 29 | WACOM_BEE, |
29 | WACOM_MO, | 30 | WACOM_MO, |
31 | TABLETPC, | ||
30 | MAX_TYPE | 32 | MAX_TYPE |
31 | }; | 33 | }; |
32 | 34 | ||
@@ -38,6 +40,8 @@ struct wacom_features { | |||
38 | int pressure_max; | 40 | int pressure_max; |
39 | int distance_max; | 41 | int distance_max; |
40 | int type; | 42 | int type; |
43 | int touch_x_max; | ||
44 | int touch_y_max; | ||
41 | }; | 45 | }; |
42 | 46 | ||
43 | struct wacom_wac { | 47 | struct wacom_wac { |
diff --git a/drivers/input/touchscreen/elo.c b/drivers/input/touchscreen/elo.c index d20689cdbd5d..8f38c5e55ce6 100644 --- a/drivers/input/touchscreen/elo.c +++ b/drivers/input/touchscreen/elo.c | |||
@@ -262,7 +262,7 @@ static int elo_setup_10(struct elo *elo) | |||
262 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); | 262 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); |
263 | 263 | ||
264 | printk(KERN_INFO "elo: %sTouch touchscreen, fw: %02x.%02x, " | 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 | elo_types[(packet[1] -'0') & 0x03], | 266 | elo_types[(packet[1] -'0') & 0x03], |
267 | packet[5], packet[4], packet[3], packet[7]); | 267 | packet[5], packet[4], packet[3], packet[7]); |
268 | 268 | ||
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c index 3ab6362f043c..928d2ed8865f 100644 --- a/drivers/input/xen-kbdfront.c +++ b/drivers/input/xen-kbdfront.c | |||
@@ -323,7 +323,7 @@ static struct xenbus_device_id xenkbd_ids[] = { | |||
323 | { "" } | 323 | { "" } |
324 | }; | 324 | }; |
325 | 325 | ||
326 | static struct xenbus_driver xenkbd = { | 326 | static struct xenbus_driver xenkbd_driver = { |
327 | .name = "vkbd", | 327 | .name = "vkbd", |
328 | .owner = THIS_MODULE, | 328 | .owner = THIS_MODULE, |
329 | .ids = xenkbd_ids, | 329 | .ids = xenkbd_ids, |
@@ -342,12 +342,12 @@ static int __init xenkbd_init(void) | |||
342 | if (xen_initial_domain()) | 342 | if (xen_initial_domain()) |
343 | return -ENODEV; | 343 | return -ENODEV; |
344 | 344 | ||
345 | return xenbus_register_frontend(&xenkbd); | 345 | return xenbus_register_frontend(&xenkbd_driver); |
346 | } | 346 | } |
347 | 347 | ||
348 | static void __exit xenkbd_cleanup(void) | 348 | static void __exit xenkbd_cleanup(void) |
349 | { | 349 | { |
350 | xenbus_unregister_driver(&xenkbd); | 350 | xenbus_unregister_driver(&xenkbd_driver); |
351 | } | 351 | } |
352 | 352 | ||
353 | module_init(xenkbd_init); | 353 | module_init(xenkbd_init); |