diff options
Diffstat (limited to 'drivers/usb/input')
-rw-r--r-- | drivers/usb/input/Kconfig | 56 | ||||
-rw-r--r-- | drivers/usb/input/Makefile | 1 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 14 | ||||
-rw-r--r-- | drivers/usb/input/hid-ff.c | 6 | ||||
-rw-r--r-- | drivers/usb/input/hid.h | 5 | ||||
-rw-r--r-- | drivers/usb/input/keyspan_remote.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/usbtouchscreen.c | 605 | ||||
-rw-r--r-- | drivers/usb/input/wacom.c | 136 |
8 files changed, 740 insertions, 85 deletions
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig index 5246b35301de..650103bc9618 100644 --- a/drivers/usb/input/Kconfig +++ b/drivers/usb/input/Kconfig | |||
@@ -200,45 +200,41 @@ config USB_POWERMATE | |||
200 | To compile this driver as a module, choose M here: the | 200 | To compile this driver as a module, choose M here: the |
201 | module will be called powermate. | 201 | module will be called powermate. |
202 | 202 | ||
203 | config USB_MTOUCH | 203 | config USB_TOUCHSCREEN |
204 | tristate "MicroTouch USB Touchscreen Driver" | 204 | tristate "USB Touchscreen Driver" |
205 | depends on USB && INPUT | 205 | depends on USB && INPUT |
206 | ---help--- | 206 | ---help--- |
207 | Say Y here if you want to use a MicroTouch (Now 3M) USB | 207 | USB Touchscreen driver for: |
208 | Touchscreen controller. | 208 | - eGalax Touchkit USB |
209 | - PanJit TouchSet USB | ||
210 | - 3M MicroTouch USB | ||
211 | - ITM | ||
209 | 212 | ||
210 | See <file:Documentation/usb/mtouch.txt> for additional information. | 213 | Have a look at <http://linux.chapter7.ch/touchkit/> for |
211 | 214 | a usage description and the required user-space stuff. | |
212 | To compile this driver as a module, choose M here: the | ||
213 | module will be called mtouchusb. | ||
214 | |||
215 | config USB_ITMTOUCH | ||
216 | tristate "ITM Touch USB Touchscreen Driver" | ||
217 | depends on USB && INPUT | ||
218 | ---help--- | ||
219 | Say Y here if you want to use a ITM Touch USB | ||
220 | Touchscreen controller. | ||
221 | |||
222 | This touchscreen is used in LG 1510SF monitors. | ||
223 | 215 | ||
224 | To compile this driver as a module, choose M here: the | 216 | To compile this driver as a module, choose M here: the |
225 | module will be called itmtouch. | 217 | module will be called usbtouchscreen. |
226 | 218 | ||
227 | config USB_EGALAX | 219 | config USB_TOUCHSCREEN_EGALAX |
228 | tristate "eGalax TouchKit USB Touchscreen Driver" | 220 | default y |
229 | depends on USB && INPUT | 221 | bool "eGalax device support" if EMBEDDED |
230 | ---help--- | 222 | depends on USB_TOUCHSCREEN |
231 | Say Y here if you want to use a eGalax TouchKit USB | ||
232 | Touchscreen controller. | ||
233 | 223 | ||
234 | The driver has been tested on a Xenarc 700TSV monitor | 224 | config USB_TOUCHSCREEN_PANJIT |
235 | with eGalax touchscreen. | 225 | default y |
226 | bool "PanJit device support" if EMBEDDED | ||
227 | depends on USB_TOUCHSCREEN | ||
236 | 228 | ||
237 | Have a look at <http://linux.chapter7.ch/touchkit/> for | 229 | config USB_TOUCHSCREEN_3M |
238 | a usage description and the required user-space stuff. | 230 | default y |
231 | bool "3M/Microtouch device support" if EMBEDDED | ||
232 | depends on USB_TOUCHSCREEN | ||
239 | 233 | ||
240 | To compile this driver as a module, choose M here: the | 234 | config USB_TOUCHSCREEN_ITM |
241 | module will be called touchkitusb. | 235 | default y |
236 | bool "ITM device support" if EMBEDDED | ||
237 | depends on USB_TOUCHSCREEN | ||
242 | 238 | ||
243 | config USB_YEALINK | 239 | config USB_YEALINK |
244 | tristate "Yealink usb-p1k voip phone" | 240 | tristate "Yealink usb-p1k voip phone" |
diff --git a/drivers/usb/input/Makefile b/drivers/usb/input/Makefile index d512d9f488fe..764114529c56 100644 --- a/drivers/usb/input/Makefile +++ b/drivers/usb/input/Makefile | |||
@@ -37,6 +37,7 @@ obj-$(CONFIG_USB_MOUSE) += usbmouse.o | |||
37 | obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o | 37 | obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o |
38 | obj-$(CONFIG_USB_ITMTOUCH) += itmtouch.o | 38 | obj-$(CONFIG_USB_ITMTOUCH) += itmtouch.o |
39 | obj-$(CONFIG_USB_EGALAX) += touchkitusb.o | 39 | obj-$(CONFIG_USB_EGALAX) += touchkitusb.o |
40 | obj-$(CONFIG_USB_TOUCHSCREEN) += usbtouchscreen.o | ||
40 | obj-$(CONFIG_USB_POWERMATE) += powermate.o | 41 | obj-$(CONFIG_USB_POWERMATE) += powermate.o |
41 | obj-$(CONFIG_USB_WACOM) += wacom.o | 42 | obj-$(CONFIG_USB_WACOM) += wacom.o |
42 | obj-$(CONFIG_USB_ACECAD) += acecad.o | 43 | obj-$(CONFIG_USB_ACECAD) += acecad.o |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index d4bf1701046b..f419bd82ab7f 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -1372,6 +1372,11 @@ void hid_close(struct hid_device *hid) | |||
1372 | usb_kill_urb(hid->urbin); | 1372 | usb_kill_urb(hid->urbin); |
1373 | } | 1373 | } |
1374 | 1374 | ||
1375 | #define USB_VENDOR_ID_PANJIT 0x134c | ||
1376 | |||
1377 | #define USB_VENDOR_ID_SILVERCREST 0x062a | ||
1378 | #define USB_DEVICE_ID_SILVERCREST_KB 0x0201 | ||
1379 | |||
1375 | /* | 1380 | /* |
1376 | * Initialize all reports | 1381 | * Initialize all reports |
1377 | */ | 1382 | */ |
@@ -1655,9 +1660,12 @@ static const struct hid_blacklist { | |||
1655 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE }, | 1660 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE }, |
1656 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE }, | 1661 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE }, |
1657 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE }, | 1662 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE }, |
1663 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 3, HID_QUIRK_IGNORE }, | ||
1664 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 4, HID_QUIRK_IGNORE }, | ||
1658 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 5, HID_QUIRK_IGNORE }, | 1665 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 5, HID_QUIRK_IGNORE }, |
1659 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE }, | 1666 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE }, |
1660 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF, HID_QUIRK_IGNORE }, | 1667 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF, HID_QUIRK_IGNORE }, |
1668 | { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF + 3, HID_QUIRK_IGNORE }, | ||
1661 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, | 1669 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, |
1662 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, | 1670 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, |
1663 | 1671 | ||
@@ -1675,6 +1683,7 @@ static const struct hid_blacklist { | |||
1675 | { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, | 1683 | { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, |
1676 | { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, | 1684 | { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, |
1677 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | 1685 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |
1686 | { USB_VENDOR_ID_SILVERCREST, USB_DEVICE_ID_SILVERCREST_KB, HID_QUIRK_NOGET }, | ||
1678 | 1687 | ||
1679 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE }, | 1688 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE }, |
1680 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, | 1689 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, |
@@ -1701,6 +1710,11 @@ static const struct hid_blacklist { | |||
1701 | { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, | 1710 | { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, |
1702 | { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, | 1711 | { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, |
1703 | 1712 | ||
1713 | { USB_VENDOR_ID_PANJIT, 0x0001, HID_QUIRK_IGNORE }, | ||
1714 | { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE }, | ||
1715 | { USB_VENDOR_ID_PANJIT, 0x0003, HID_QUIRK_IGNORE }, | ||
1716 | { USB_VENDOR_ID_PANJIT, 0x0004, HID_QUIRK_IGNORE }, | ||
1717 | |||
1704 | { 0, 0 } | 1718 | { 0, 0 } |
1705 | }; | 1719 | }; |
1706 | 1720 | ||
diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c index 72e698658b53..d5c91ee67991 100644 --- a/drivers/usb/input/hid-ff.c +++ b/drivers/usb/input/hid-ff.c | |||
@@ -34,12 +34,6 @@ | |||
34 | 34 | ||
35 | #include "hid.h" | 35 | #include "hid.h" |
36 | 36 | ||
37 | /* Drivers' initializing functions */ | ||
38 | extern int hid_lgff_init(struct hid_device* hid); | ||
39 | extern int hid_lg3d_init(struct hid_device* hid); | ||
40 | extern int hid_pid_init(struct hid_device* hid); | ||
41 | extern int hid_tmff_init(struct hid_device* hid); | ||
42 | |||
43 | /* | 37 | /* |
44 | * This table contains pointers to initializers. To add support for new | 38 | * This table contains pointers to initializers. To add support for new |
45 | * devices, you need to add the USB vendor and product ids here. | 39 | * devices, you need to add the USB vendor and product ids here. |
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index 4e1b784fe527..9c62837b5b89 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h | |||
@@ -533,3 +533,8 @@ static inline int hid_ff_event(struct hid_device *hid, struct input_dev *input, | |||
533 | return hid->ff_event(hid, input, type, code, value); | 533 | return hid->ff_event(hid, input, type, code, value); |
534 | return -ENOSYS; | 534 | return -ENOSYS; |
535 | } | 535 | } |
536 | |||
537 | int hid_lgff_init(struct hid_device* hid); | ||
538 | int hid_tmff_init(struct hid_device* hid); | ||
539 | int hid_pid_init(struct hid_device* hid); | ||
540 | |||
diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c index b4a051b549d1..3d911976f378 100644 --- a/drivers/usb/input/keyspan_remote.c +++ b/drivers/usb/input/keyspan_remote.c | |||
@@ -297,6 +297,8 @@ static void keyspan_check_data(struct usb_keyspan *remote, struct pt_regs *regs) | |||
297 | remote->data.bits_left -= 6; | 297 | remote->data.bits_left -= 6; |
298 | } else { | 298 | } else { |
299 | err("%s - Error in message, invalid toggle.\n", __FUNCTION__); | 299 | err("%s - Error in message, invalid toggle.\n", __FUNCTION__); |
300 | remote->stage = 0; | ||
301 | return; | ||
300 | } | 302 | } |
301 | 303 | ||
302 | keyspan_load_tester(remote, 5); | 304 | keyspan_load_tester(remote, 5); |
diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c new file mode 100644 index 000000000000..e9a07c1e905b --- /dev/null +++ b/drivers/usb/input/usbtouchscreen.c | |||
@@ -0,0 +1,605 @@ | |||
1 | /****************************************************************************** | ||
2 | * usbtouchscreen.c | ||
3 | * Driver for USB Touchscreens, supporting those devices: | ||
4 | * - eGalax Touchkit | ||
5 | * - 3M/Microtouch | ||
6 | * - ITM | ||
7 | * - PanJit TouchSet | ||
8 | * | ||
9 | * Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch> | ||
10 | * Copyright (C) by Todd E. Johnson (mtouchusb.c) | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License as | ||
14 | * published by the Free Software Foundation; either version 2 of the | ||
15 | * License, or (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, but | ||
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
20 | * General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
25 | * | ||
26 | * Driver is based on touchkitusb.c | ||
27 | * - ITM parts are from itmtouch.c | ||
28 | * - 3M parts are from mtouchusb.c | ||
29 | * - PanJit parts are from an unmerged driver by Lanslott Gish | ||
30 | * | ||
31 | *****************************************************************************/ | ||
32 | |||
33 | //#define DEBUG | ||
34 | |||
35 | #include <linux/config.h> | ||
36 | #include <linux/kernel.h> | ||
37 | #include <linux/slab.h> | ||
38 | #include <linux/input.h> | ||
39 | #include <linux/module.h> | ||
40 | #include <linux/init.h> | ||
41 | #include <linux/usb.h> | ||
42 | #include <linux/usb_input.h> | ||
43 | |||
44 | |||
45 | #define DRIVER_VERSION "v0.3" | ||
46 | #define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>" | ||
47 | #define DRIVER_DESC "USB Touchscreen Driver" | ||
48 | |||
49 | static int swap_xy; | ||
50 | module_param(swap_xy, bool, 0644); | ||
51 | MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped."); | ||
52 | |||
53 | /* device specifc data/functions */ | ||
54 | struct usbtouch_usb; | ||
55 | struct usbtouch_device_info { | ||
56 | int min_xc, max_xc; | ||
57 | int min_yc, max_yc; | ||
58 | int min_press, max_press; | ||
59 | int rept_size; | ||
60 | int flags; | ||
61 | |||
62 | void (*process_pkt) (struct usbtouch_usb *usbtouch, struct pt_regs *regs, unsigned char *pkt, int len); | ||
63 | int (*read_data) (unsigned char *pkt, int *x, int *y, int *touch, int *press); | ||
64 | int (*init) (struct usbtouch_usb *usbtouch); | ||
65 | }; | ||
66 | |||
67 | #define USBTOUCH_FLG_BUFFER 0x01 | ||
68 | |||
69 | |||
70 | /* a usbtouch device */ | ||
71 | struct usbtouch_usb { | ||
72 | unsigned char *data; | ||
73 | dma_addr_t data_dma; | ||
74 | unsigned char *buffer; | ||
75 | int buf_len; | ||
76 | struct urb *irq; | ||
77 | struct usb_device *udev; | ||
78 | struct input_dev *input; | ||
79 | struct usbtouch_device_info *type; | ||
80 | char name[128]; | ||
81 | char phys[64]; | ||
82 | }; | ||
83 | |||
84 | static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, | ||
85 | struct pt_regs *regs, unsigned char *pkt, int len); | ||
86 | |||
87 | /* device types */ | ||
88 | enum { | ||
89 | DEVTPYE_DUMMY = -1, | ||
90 | DEVTYPE_EGALAX, | ||
91 | DEVTYPE_PANJIT, | ||
92 | DEVTYPE_3M, | ||
93 | DEVTYPE_ITM, | ||
94 | }; | ||
95 | |||
96 | static struct usb_device_id usbtouch_devices[] = { | ||
97 | #ifdef CONFIG_USB_TOUCHSCREEN_EGALAX | ||
98 | {USB_DEVICE(0x3823, 0x0001), .driver_info = DEVTYPE_EGALAX}, | ||
99 | {USB_DEVICE(0x0123, 0x0001), .driver_info = DEVTYPE_EGALAX}, | ||
100 | {USB_DEVICE(0x0eef, 0x0001), .driver_info = DEVTYPE_EGALAX}, | ||
101 | {USB_DEVICE(0x0eef, 0x0002), .driver_info = DEVTYPE_EGALAX}, | ||
102 | #endif | ||
103 | |||
104 | #ifdef CONFIG_USB_TOUCHSCREEN_PANJIT | ||
105 | {USB_DEVICE(0x134c, 0x0001), .driver_info = DEVTYPE_PANJIT}, | ||
106 | {USB_DEVICE(0x134c, 0x0002), .driver_info = DEVTYPE_PANJIT}, | ||
107 | {USB_DEVICE(0x134c, 0x0003), .driver_info = DEVTYPE_PANJIT}, | ||
108 | {USB_DEVICE(0x134c, 0x0004), .driver_info = DEVTYPE_PANJIT}, | ||
109 | #endif | ||
110 | |||
111 | #ifdef CONFIG_USB_TOUCHSCREEN_3M | ||
112 | {USB_DEVICE(0x0596, 0x0001), .driver_info = DEVTYPE_3M}, | ||
113 | #endif | ||
114 | |||
115 | #ifdef CONFIG_USB_TOUCHSCREEN_ITM | ||
116 | {USB_DEVICE(0x0403, 0xf9e9), .driver_info = DEVTYPE_ITM}, | ||
117 | #endif | ||
118 | |||
119 | {} | ||
120 | }; | ||
121 | |||
122 | |||
123 | /***************************************************************************** | ||
124 | * eGalax part | ||
125 | */ | ||
126 | |||
127 | #ifdef CONFIG_USB_TOUCHSCREEN_EGALAX | ||
128 | |||
129 | #define EGALAX_PKT_TYPE_MASK 0xFE | ||
130 | #define EGALAX_PKT_TYPE_REPT 0x80 | ||
131 | #define EGALAX_PKT_TYPE_DIAG 0x0A | ||
132 | |||
133 | static int egalax_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | ||
134 | { | ||
135 | if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) | ||
136 | return 0; | ||
137 | |||
138 | *x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); | ||
139 | *y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); | ||
140 | *touch = pkt[0] & 0x01; | ||
141 | |||
142 | return 1; | ||
143 | |||
144 | } | ||
145 | |||
146 | static int egalax_get_pkt_len(unsigned char *buf) | ||
147 | { | ||
148 | switch (buf[0] & EGALAX_PKT_TYPE_MASK) { | ||
149 | case EGALAX_PKT_TYPE_REPT: | ||
150 | return 5; | ||
151 | |||
152 | case EGALAX_PKT_TYPE_DIAG: | ||
153 | return buf[1] + 2; | ||
154 | } | ||
155 | |||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | static void egalax_process(struct usbtouch_usb *usbtouch, struct pt_regs *regs, | ||
160 | unsigned char *pkt, int len) | ||
161 | { | ||
162 | unsigned char *buffer; | ||
163 | int pkt_len, buf_len, pos; | ||
164 | |||
165 | /* if the buffer contains data, append */ | ||
166 | if (unlikely(usbtouch->buf_len)) { | ||
167 | int tmp; | ||
168 | |||
169 | /* if only 1 byte in buffer, add another one to get length */ | ||
170 | if (usbtouch->buf_len == 1) | ||
171 | usbtouch->buffer[1] = pkt[0]; | ||
172 | |||
173 | pkt_len = egalax_get_pkt_len(usbtouch->buffer); | ||
174 | |||
175 | /* unknown packet: drop everything */ | ||
176 | if (!pkt_len) | ||
177 | return; | ||
178 | |||
179 | /* append, process */ | ||
180 | tmp = pkt_len - usbtouch->buf_len; | ||
181 | memcpy(usbtouch->buffer + usbtouch->buf_len, pkt, tmp); | ||
182 | usbtouch_process_pkt(usbtouch, regs, usbtouch->buffer, pkt_len); | ||
183 | |||
184 | buffer = pkt + tmp; | ||
185 | buf_len = len - tmp; | ||
186 | } else { | ||
187 | buffer = pkt; | ||
188 | buf_len = len; | ||
189 | } | ||
190 | |||
191 | /* only one byte left in buffer */ | ||
192 | if (unlikely(buf_len == 1)) { | ||
193 | usbtouch->buffer[0] = buffer[0]; | ||
194 | usbtouch->buf_len = 1; | ||
195 | return; | ||
196 | } | ||
197 | |||
198 | /* loop over the buffer */ | ||
199 | pos = 0; | ||
200 | while (pos < buf_len) { | ||
201 | /* get packet len */ | ||
202 | pkt_len = egalax_get_pkt_len(buffer + pos); | ||
203 | |||
204 | /* unknown packet: drop everything */ | ||
205 | if (unlikely(!pkt_len)) | ||
206 | return; | ||
207 | |||
208 | /* full packet: process */ | ||
209 | if (likely(pkt_len <= buf_len)) { | ||
210 | usbtouch_process_pkt(usbtouch, regs, buffer + pos, pkt_len); | ||
211 | } else { | ||
212 | /* incomplete packet: save in buffer */ | ||
213 | memcpy(usbtouch->buffer, buffer + pos, buf_len - pos); | ||
214 | usbtouch->buf_len = buf_len - pos; | ||
215 | } | ||
216 | pos += pkt_len; | ||
217 | } | ||
218 | } | ||
219 | #endif | ||
220 | |||
221 | |||
222 | /***************************************************************************** | ||
223 | * PanJit Part | ||
224 | */ | ||
225 | #ifdef CONFIG_USB_TOUCHSCREEN_PANJIT | ||
226 | static int panjit_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | ||
227 | { | ||
228 | *x = ((pkt[2] & 0x0F) << 8) | pkt[1]; | ||
229 | *y = ((pkt[4] & 0x0F) << 8) | pkt[3]; | ||
230 | *touch = pkt[0] & 0x01; | ||
231 | |||
232 | return 1; | ||
233 | } | ||
234 | #endif | ||
235 | |||
236 | |||
237 | /***************************************************************************** | ||
238 | * 3M/Microtouch Part | ||
239 | */ | ||
240 | #ifdef CONFIG_USB_TOUCHSCREEN_3M | ||
241 | |||
242 | #define MTOUCHUSB_ASYNC_REPORT 1 | ||
243 | #define MTOUCHUSB_RESET 7 | ||
244 | #define MTOUCHUSB_REQ_CTRLLR_ID 10 | ||
245 | |||
246 | static int mtouch_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | ||
247 | { | ||
248 | *x = (pkt[8] << 8) | pkt[7]; | ||
249 | *y = (pkt[10] << 8) | pkt[9]; | ||
250 | *touch = (pkt[2] & 0x40) ? 1 : 0; | ||
251 | |||
252 | return 1; | ||
253 | } | ||
254 | |||
255 | static int mtouch_init(struct usbtouch_usb *usbtouch) | ||
256 | { | ||
257 | int ret; | ||
258 | |||
259 | ret = usb_control_msg(usbtouch->udev, usb_rcvctrlpipe(usbtouch->udev, 0), | ||
260 | MTOUCHUSB_RESET, | ||
261 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
262 | 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); | ||
263 | dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d", | ||
264 | __FUNCTION__, ret); | ||
265 | if (ret < 0) | ||
266 | return ret; | ||
267 | |||
268 | ret = usb_control_msg(usbtouch->udev, usb_rcvctrlpipe(usbtouch->udev, 0), | ||
269 | MTOUCHUSB_ASYNC_REPORT, | ||
270 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
271 | 1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT); | ||
272 | dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d", | ||
273 | __FUNCTION__, ret); | ||
274 | if (ret < 0) | ||
275 | return ret; | ||
276 | |||
277 | return 0; | ||
278 | } | ||
279 | #endif | ||
280 | |||
281 | |||
282 | /***************************************************************************** | ||
283 | * ITM Part | ||
284 | */ | ||
285 | #ifdef CONFIG_USB_TOUCHSCREEN_ITM | ||
286 | static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | ||
287 | { | ||
288 | *x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); | ||
289 | *x = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); | ||
290 | *press = ((pkt[2] & 0x1F) << 7) | (pkt[5] & 0x7F); | ||
291 | *touch = ~pkt[7] & 0x20; | ||
292 | |||
293 | return 1; | ||
294 | } | ||
295 | #endif | ||
296 | |||
297 | |||
298 | /***************************************************************************** | ||
299 | * the different device descriptors | ||
300 | */ | ||
301 | static struct usbtouch_device_info usbtouch_dev_info[] = { | ||
302 | #ifdef CONFIG_USB_TOUCHSCREEN_EGALAX | ||
303 | [DEVTYPE_EGALAX] = { | ||
304 | .min_xc = 0x0, | ||
305 | .max_xc = 0x07ff, | ||
306 | .min_yc = 0x0, | ||
307 | .max_yc = 0x07ff, | ||
308 | .rept_size = 16, | ||
309 | .flags = USBTOUCH_FLG_BUFFER, | ||
310 | .process_pkt = egalax_process, | ||
311 | .read_data = egalax_read_data, | ||
312 | }, | ||
313 | #endif | ||
314 | |||
315 | #ifdef CONFIG_USB_TOUCHSCREEN_PANJIT | ||
316 | [DEVTYPE_PANJIT] = { | ||
317 | .min_xc = 0x0, | ||
318 | .max_xc = 0x0fff, | ||
319 | .min_yc = 0x0, | ||
320 | .max_yc = 0x0fff, | ||
321 | .rept_size = 8, | ||
322 | .read_data = panjit_read_data, | ||
323 | }, | ||
324 | #endif | ||
325 | |||
326 | #ifdef CONFIG_USB_TOUCHSCREEN_3M | ||
327 | [DEVTYPE_3M] = { | ||
328 | .min_xc = 0x0, | ||
329 | .max_xc = 0x4000, | ||
330 | .min_yc = 0x0, | ||
331 | .max_yc = 0x4000, | ||
332 | .rept_size = 11, | ||
333 | .read_data = mtouch_read_data, | ||
334 | .init = mtouch_init, | ||
335 | }, | ||
336 | #endif | ||
337 | |||
338 | #ifdef CONFIG_USB_TOUCHSCREEN_ITM | ||
339 | [DEVTYPE_ITM] = { | ||
340 | .min_xc = 0x0, | ||
341 | .max_xc = 0x0fff, | ||
342 | .min_yc = 0x0, | ||
343 | .max_yc = 0x0fff, | ||
344 | .max_press = 0xff, | ||
345 | .rept_size = 8, | ||
346 | .read_data = itm_read_data, | ||
347 | }, | ||
348 | #endif | ||
349 | }; | ||
350 | |||
351 | |||
352 | /***************************************************************************** | ||
353 | * Generic Part | ||
354 | */ | ||
355 | static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, | ||
356 | struct pt_regs *regs, unsigned char *pkt, int len) | ||
357 | { | ||
358 | int x, y, touch, press; | ||
359 | struct usbtouch_device_info *type = usbtouch->type; | ||
360 | |||
361 | if (!type->read_data(pkt, &x, &y, &touch, &press)) | ||
362 | return; | ||
363 | |||
364 | input_regs(usbtouch->input, regs); | ||
365 | input_report_key(usbtouch->input, BTN_TOUCH, touch); | ||
366 | |||
367 | if (swap_xy) { | ||
368 | input_report_abs(usbtouch->input, ABS_X, y); | ||
369 | input_report_abs(usbtouch->input, ABS_Y, x); | ||
370 | } else { | ||
371 | input_report_abs(usbtouch->input, ABS_X, x); | ||
372 | input_report_abs(usbtouch->input, ABS_Y, y); | ||
373 | } | ||
374 | if (type->max_press) | ||
375 | input_report_abs(usbtouch->input, ABS_PRESSURE, press); | ||
376 | input_sync(usbtouch->input); | ||
377 | } | ||
378 | |||
379 | |||
380 | static void usbtouch_irq(struct urb *urb, struct pt_regs *regs) | ||
381 | { | ||
382 | struct usbtouch_usb *usbtouch = urb->context; | ||
383 | int retval; | ||
384 | |||
385 | switch (urb->status) { | ||
386 | case 0: | ||
387 | /* success */ | ||
388 | break; | ||
389 | case -ETIMEDOUT: | ||
390 | /* this urb is timing out */ | ||
391 | dbg("%s - urb timed out - was the device unplugged?", | ||
392 | __FUNCTION__); | ||
393 | return; | ||
394 | case -ECONNRESET: | ||
395 | case -ENOENT: | ||
396 | case -ESHUTDOWN: | ||
397 | /* this urb is terminated, clean up */ | ||
398 | dbg("%s - urb shutting down with status: %d", | ||
399 | __FUNCTION__, urb->status); | ||
400 | return; | ||
401 | default: | ||
402 | dbg("%s - nonzero urb status received: %d", | ||
403 | __FUNCTION__, urb->status); | ||
404 | goto exit; | ||
405 | } | ||
406 | |||
407 | usbtouch->type->process_pkt(usbtouch, regs, usbtouch->data, urb->actual_length); | ||
408 | |||
409 | exit: | ||
410 | retval = usb_submit_urb(urb, GFP_ATOMIC); | ||
411 | if (retval) | ||
412 | err("%s - usb_submit_urb failed with result: %d", | ||
413 | __FUNCTION__, retval); | ||
414 | } | ||
415 | |||
416 | static int usbtouch_open(struct input_dev *input) | ||
417 | { | ||
418 | struct usbtouch_usb *usbtouch = input->private; | ||
419 | |||
420 | usbtouch->irq->dev = usbtouch->udev; | ||
421 | |||
422 | if (usb_submit_urb(usbtouch->irq, GFP_KERNEL)) | ||
423 | return -EIO; | ||
424 | |||
425 | return 0; | ||
426 | } | ||
427 | |||
428 | static void usbtouch_close(struct input_dev *input) | ||
429 | { | ||
430 | struct usbtouch_usb *usbtouch = input->private; | ||
431 | |||
432 | usb_kill_urb(usbtouch->irq); | ||
433 | } | ||
434 | |||
435 | |||
436 | static void usbtouch_free_buffers(struct usb_device *udev, | ||
437 | struct usbtouch_usb *usbtouch) | ||
438 | { | ||
439 | if (usbtouch->data) | ||
440 | usb_buffer_free(udev, usbtouch->type->rept_size, | ||
441 | usbtouch->data, usbtouch->data_dma); | ||
442 | kfree(usbtouch->buffer); | ||
443 | } | ||
444 | |||
445 | |||
446 | static int usbtouch_probe(struct usb_interface *intf, | ||
447 | const struct usb_device_id *id) | ||
448 | { | ||
449 | struct usbtouch_usb *usbtouch; | ||
450 | struct input_dev *input_dev; | ||
451 | struct usb_host_interface *interface; | ||
452 | struct usb_endpoint_descriptor *endpoint; | ||
453 | struct usb_device *udev = interface_to_usbdev(intf); | ||
454 | struct usbtouch_device_info *type; | ||
455 | int err; | ||
456 | |||
457 | interface = intf->cur_altsetting; | ||
458 | endpoint = &interface->endpoint[0].desc; | ||
459 | |||
460 | usbtouch = kzalloc(sizeof(struct usbtouch_usb), GFP_KERNEL); | ||
461 | input_dev = input_allocate_device(); | ||
462 | if (!usbtouch || !input_dev) | ||
463 | goto out_free; | ||
464 | |||
465 | type = &usbtouch_dev_info[id->driver_info]; | ||
466 | usbtouch->type = type; | ||
467 | if (!type->process_pkt) | ||
468 | type->process_pkt = usbtouch_process_pkt; | ||
469 | |||
470 | usbtouch->data = usb_buffer_alloc(udev, type->rept_size, | ||
471 | SLAB_KERNEL, &usbtouch->data_dma); | ||
472 | if (!usbtouch->data) | ||
473 | goto out_free; | ||
474 | |||
475 | if (type->flags & USBTOUCH_FLG_BUFFER) { | ||
476 | usbtouch->buffer = kmalloc(type->rept_size, GFP_KERNEL); | ||
477 | if (!usbtouch->buffer) | ||
478 | goto out_free_buffers; | ||
479 | } | ||
480 | |||
481 | usbtouch->irq = usb_alloc_urb(0, GFP_KERNEL); | ||
482 | if (!usbtouch->irq) { | ||
483 | dbg("%s - usb_alloc_urb failed: usbtouch->irq", __FUNCTION__); | ||
484 | goto out_free_buffers; | ||
485 | } | ||
486 | |||
487 | usbtouch->udev = udev; | ||
488 | usbtouch->input = input_dev; | ||
489 | |||
490 | if (udev->manufacturer) | ||
491 | strlcpy(usbtouch->name, udev->manufacturer, sizeof(usbtouch->name)); | ||
492 | |||
493 | if (udev->product) { | ||
494 | if (udev->manufacturer) | ||
495 | strlcat(usbtouch->name, " ", sizeof(usbtouch->name)); | ||
496 | strlcat(usbtouch->name, udev->product, sizeof(usbtouch->name)); | ||
497 | } | ||
498 | |||
499 | if (!strlen(usbtouch->name)) | ||
500 | snprintf(usbtouch->name, sizeof(usbtouch->name), | ||
501 | "USB Touchscreen %04x:%04x", | ||
502 | le16_to_cpu(udev->descriptor.idVendor), | ||
503 | le16_to_cpu(udev->descriptor.idProduct)); | ||
504 | |||
505 | usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys)); | ||
506 | strlcpy(usbtouch->phys, "/input0", sizeof(usbtouch->phys)); | ||
507 | |||
508 | input_dev->name = usbtouch->name; | ||
509 | input_dev->phys = usbtouch->phys; | ||
510 | usb_to_input_id(udev, &input_dev->id); | ||
511 | input_dev->cdev.dev = &intf->dev; | ||
512 | input_dev->private = usbtouch; | ||
513 | input_dev->open = usbtouch_open; | ||
514 | input_dev->close = usbtouch_close; | ||
515 | |||
516 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); | ||
517 | input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); | ||
518 | input_set_abs_params(input_dev, ABS_X, type->min_xc, type->max_xc, 0, 0); | ||
519 | input_set_abs_params(input_dev, ABS_Y, type->min_yc, type->max_yc, 0, 0); | ||
520 | if (type->max_press) | ||
521 | input_set_abs_params(input_dev, ABS_PRESSURE, type->min_press, | ||
522 | type->max_press, 0, 0); | ||
523 | |||
524 | usb_fill_int_urb(usbtouch->irq, usbtouch->udev, | ||
525 | usb_rcvintpipe(usbtouch->udev, 0x81), | ||
526 | usbtouch->data, type->rept_size, | ||
527 | usbtouch_irq, usbtouch, endpoint->bInterval); | ||
528 | |||
529 | usbtouch->irq->transfer_dma = usbtouch->data_dma; | ||
530 | usbtouch->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | ||
531 | |||
532 | /* device specific init */ | ||
533 | if (type->init) { | ||
534 | err = type->init(usbtouch); | ||
535 | if (err) { | ||
536 | dbg("%s - type->init() failed, err: %d", __FUNCTION__, err); | ||
537 | goto out_free_buffers; | ||
538 | } | ||
539 | } | ||
540 | |||
541 | err = input_register_device(usbtouch->input); | ||
542 | if (err) { | ||
543 | dbg("%s - input_register_device failed, err: %d", __FUNCTION__, err); | ||
544 | goto out_free_buffers; | ||
545 | } | ||
546 | |||
547 | usb_set_intfdata(intf, usbtouch); | ||
548 | |||
549 | return 0; | ||
550 | |||
551 | out_free_buffers: | ||
552 | usbtouch_free_buffers(udev, usbtouch); | ||
553 | out_free: | ||
554 | input_free_device(input_dev); | ||
555 | kfree(usbtouch); | ||
556 | return -ENOMEM; | ||
557 | } | ||
558 | |||
559 | static void usbtouch_disconnect(struct usb_interface *intf) | ||
560 | { | ||
561 | struct usbtouch_usb *usbtouch = usb_get_intfdata(intf); | ||
562 | |||
563 | dbg("%s - called", __FUNCTION__); | ||
564 | |||
565 | if (!usbtouch) | ||
566 | return; | ||
567 | |||
568 | dbg("%s - usbtouch is initialized, cleaning up", __FUNCTION__); | ||
569 | usb_set_intfdata(intf, NULL); | ||
570 | usb_kill_urb(usbtouch->irq); | ||
571 | input_unregister_device(usbtouch->input); | ||
572 | usb_free_urb(usbtouch->irq); | ||
573 | usbtouch_free_buffers(interface_to_usbdev(intf), usbtouch); | ||
574 | kfree(usbtouch); | ||
575 | } | ||
576 | |||
577 | MODULE_DEVICE_TABLE(usb, usbtouch_devices); | ||
578 | |||
579 | static struct usb_driver usbtouch_driver = { | ||
580 | .name = "usbtouchscreen", | ||
581 | .probe = usbtouch_probe, | ||
582 | .disconnect = usbtouch_disconnect, | ||
583 | .id_table = usbtouch_devices, | ||
584 | }; | ||
585 | |||
586 | static int __init usbtouch_init(void) | ||
587 | { | ||
588 | return usb_register(&usbtouch_driver); | ||
589 | } | ||
590 | |||
591 | static void __exit usbtouch_cleanup(void) | ||
592 | { | ||
593 | usb_deregister(&usbtouch_driver); | ||
594 | } | ||
595 | |||
596 | module_init(usbtouch_init); | ||
597 | module_exit(usbtouch_cleanup); | ||
598 | |||
599 | MODULE_AUTHOR(DRIVER_AUTHOR); | ||
600 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
601 | MODULE_LICENSE("GPL"); | ||
602 | |||
603 | MODULE_ALIAS("touchkitusb"); | ||
604 | MODULE_ALIAS("itmtouch"); | ||
605 | MODULE_ALIAS("mtouchusb"); | ||
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index d3e15df9e815..cf84c6096f29 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * Copyright (c) 2000 Daniel Egger <egger@suse.de> | 9 | * Copyright (c) 2000 Daniel Egger <egger@suse.de> |
10 | * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com> | 10 | * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com> |
11 | * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> | 11 | * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> |
12 | * Copyright (c) 2002-2005 Ping Cheng <pingc@wacom.com> | 12 | * Copyright (c) 2002-2006 Ping Cheng <pingc@wacom.com> |
13 | * | 13 | * |
14 | * ChangeLog: | 14 | * ChangeLog: |
15 | * v0.1 (vp) - Initial release | 15 | * v0.1 (vp) - Initial release |
@@ -56,6 +56,8 @@ | |||
56 | * - Merged wacom_intuos3_irq into wacom_intuos_irq | 56 | * - Merged wacom_intuos3_irq into wacom_intuos_irq |
57 | * v1.44 (pc) - Added support for Graphire4, Cintiq 710, Intuos3 6x11, etc. | 57 | * v1.44 (pc) - Added support for Graphire4, Cintiq 710, Intuos3 6x11, etc. |
58 | * - Report Device IDs | 58 | * - Report Device IDs |
59 | * v1.45 (pc) - Added support for DTF 521, Intuos3 12x12 and 12x19 | ||
60 | * - Minor data report fix | ||
59 | */ | 61 | */ |
60 | 62 | ||
61 | /* | 63 | /* |
@@ -78,7 +80,7 @@ | |||
78 | /* | 80 | /* |
79 | * Version Information | 81 | * Version Information |
80 | */ | 82 | */ |
81 | #define DRIVER_VERSION "v1.44" | 83 | #define DRIVER_VERSION "v1.45" |
82 | #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" | 84 | #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" |
83 | #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" | 85 | #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" |
84 | #define DRIVER_LICENSE "GPL" | 86 | #define DRIVER_LICENSE "GPL" |
@@ -99,6 +101,8 @@ enum { | |||
99 | PL, | 101 | PL, |
100 | INTUOS, | 102 | INTUOS, |
101 | INTUOS3, | 103 | INTUOS3, |
104 | INTUOS312, | ||
105 | INTUOS319, | ||
102 | CINTIQ, | 106 | CINTIQ, |
103 | MAX_TYPE | 107 | MAX_TYPE |
104 | }; | 108 | }; |
@@ -127,7 +131,19 @@ struct wacom { | |||
127 | char phys[32]; | 131 | char phys[32]; |
128 | }; | 132 | }; |
129 | 133 | ||
134 | #define USB_REQ_GET_REPORT 0x01 | ||
130 | #define USB_REQ_SET_REPORT 0x09 | 135 | #define USB_REQ_SET_REPORT 0x09 |
136 | |||
137 | static int usb_get_report(struct usb_interface *intf, unsigned char type, | ||
138 | unsigned char id, void *buf, int size) | ||
139 | { | ||
140 | return usb_control_msg(interface_to_usbdev(intf), | ||
141 | usb_rcvctrlpipe(interface_to_usbdev(intf), 0), | ||
142 | USB_REQ_GET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
143 | (type << 8) + id, intf->altsetting[0].desc.bInterfaceNumber, | ||
144 | buf, size, 100); | ||
145 | } | ||
146 | |||
131 | static int usb_set_report(struct usb_interface *intf, unsigned char type, | 147 | static int usb_set_report(struct usb_interface *intf, unsigned char type, |
132 | unsigned char id, void *buf, int size) | 148 | unsigned char id, void *buf, int size) |
133 | { | 149 | { |
@@ -206,7 +222,8 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) | |||
206 | wacom->tool[1] = BTN_TOOL_PEN; | 222 | wacom->tool[1] = BTN_TOOL_PEN; |
207 | id = STYLUS_DEVICE_ID; | 223 | id = STYLUS_DEVICE_ID; |
208 | } | 224 | } |
209 | input_report_key(dev, wacom->tool[1], id); /* report in proximity for tool */ | 225 | input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ |
226 | input_report_abs(dev, ABS_MISC, id); /* report tool id */ | ||
210 | input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); | 227 | input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); |
211 | input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); | 228 | input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); |
212 | input_report_abs(dev, ABS_PRESSURE, pressure); | 229 | input_report_abs(dev, ABS_PRESSURE, pressure); |
@@ -239,7 +256,7 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) | |||
239 | struct wacom *wacom = urb->context; | 256 | struct wacom *wacom = urb->context; |
240 | unsigned char *data = wacom->data; | 257 | unsigned char *data = wacom->data; |
241 | struct input_dev *dev = wacom->dev; | 258 | struct input_dev *dev = wacom->dev; |
242 | int retval; | 259 | int retval, id; |
243 | 260 | ||
244 | switch (urb->status) { | 261 | switch (urb->status) { |
245 | case 0: | 262 | case 0: |
@@ -263,12 +280,15 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) | |||
263 | 280 | ||
264 | input_regs(dev, regs); | 281 | input_regs(dev, regs); |
265 | if (data[1] & 0x04) { | 282 | if (data[1] & 0x04) { |
266 | input_report_key(dev, BTN_TOOL_RUBBER, (data[1] & 0x20) ? ERASER_DEVICE_ID : 0); | 283 | input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); |
267 | input_report_key(dev, BTN_TOUCH, data[1] & 0x08); | 284 | input_report_key(dev, BTN_TOUCH, data[1] & 0x08); |
285 | id = ERASER_DEVICE_ID; | ||
268 | } else { | 286 | } else { |
269 | input_report_key(dev, BTN_TOOL_PEN, (data[1] & 0x20) ? STYLUS_DEVICE_ID : 0); | 287 | input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); |
270 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); | 288 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); |
289 | id = STYLUS_DEVICE_ID; | ||
271 | } | 290 | } |
291 | input_report_abs(dev, ABS_MISC, id); /* report tool id */ | ||
272 | input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); | 292 | input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); |
273 | input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4])); | 293 | input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4])); |
274 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); | 294 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); |
@@ -312,7 +332,8 @@ static void wacom_penpartner_irq(struct urb *urb, struct pt_regs *regs) | |||
312 | } | 332 | } |
313 | 333 | ||
314 | input_regs(dev, regs); | 334 | input_regs(dev, regs); |
315 | input_report_key(dev, BTN_TOOL_PEN, STYLUS_DEVICE_ID); | 335 | input_report_key(dev, BTN_TOOL_PEN, 1); |
336 | input_report_abs(dev, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */ | ||
316 | input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[1])); | 337 | input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[1])); |
317 | input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[3])); | 338 | input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[3])); |
318 | input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127); | 339 | input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127); |
@@ -350,6 +371,8 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
350 | goto exit; | 371 | goto exit; |
351 | } | 372 | } |
352 | 373 | ||
374 | if (data[0] == 99) return; /* for Volito tablets */ | ||
375 | |||
353 | if (data[0] != 2) { | 376 | if (data[0] != 2) { |
354 | dbg("wacom_graphire_irq: received unknown report #%d", data[0]); | 377 | dbg("wacom_graphire_irq: received unknown report #%d", data[0]); |
355 | goto exit; | 378 | goto exit; |
@@ -374,10 +397,10 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
374 | case 2: /* Mouse with wheel */ | 397 | case 2: /* Mouse with wheel */ |
375 | input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); | 398 | input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); |
376 | if (wacom->features->type == WACOM_G4) { | 399 | if (wacom->features->type == WACOM_G4) { |
377 | rw = data[7] & 0x04 ? -(data[7] & 0x03) : (data[7] & 0x03); | 400 | rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : (data[7] & 0x03); |
378 | input_report_rel(dev, REL_WHEEL, rw); | 401 | input_report_rel(dev, REL_WHEEL, -rw); |
379 | } else | 402 | } else |
380 | input_report_rel(dev, REL_WHEEL, (signed char) data[6]); | 403 | input_report_rel(dev, REL_WHEEL, -(signed char) data[6]); |
381 | /* fall through */ | 404 | /* fall through */ |
382 | 405 | ||
383 | case 3: /* Mouse without wheel */ | 406 | case 3: /* Mouse without wheel */ |
@@ -406,39 +429,27 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
406 | } | 429 | } |
407 | } | 430 | } |
408 | 431 | ||
409 | input_report_key(dev, wacom->tool[0], (data[1] & 0x10) ? id : 0); | 432 | if (data[1] & 0x10) |
433 | input_report_abs(dev, ABS_MISC, id); /* report tool id */ | ||
434 | else | ||
435 | input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ | ||
436 | input_report_key(dev, wacom->tool[0], data[1] & 0x10); | ||
410 | input_sync(dev); | 437 | input_sync(dev); |
411 | 438 | ||
412 | /* send pad data */ | 439 | /* send pad data */ |
413 | if (wacom->features->type == WACOM_G4) { | 440 | if (wacom->features->type == WACOM_G4) { |
414 | /* fist time sending pad data */ | 441 | if ((wacom->serial[1] & 0xc0) != (data[7] & 0xf8)) { |
415 | if (wacom->tool[1] != BTN_TOOL_FINGER) { | 442 | wacom->id[1] = 1; |
416 | wacom->id[1] = 0; | 443 | wacom->serial[1] = (data[7] & 0xf8); |
417 | wacom->serial[1] = (data[7] & 0x38) >> 2; | ||
418 | } | ||
419 | if (data[7] & 0xf8) { | ||
420 | input_report_key(dev, BTN_0, (data[7] & 0x40)); | 444 | input_report_key(dev, BTN_0, (data[7] & 0x40)); |
421 | input_report_key(dev, BTN_4, (data[7] & 0x80)); | 445 | input_report_key(dev, BTN_4, (data[7] & 0x80)); |
422 | if (((data[7] & 0x38) >> 2) == (wacom->serial[1] & 0x0e)) | 446 | rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); |
423 | /* alter REL_WHEEL value so X apps can get it */ | ||
424 | wacom->serial[1] += (wacom->serial[1] & 0x01) ? -1 : 1; | ||
425 | else | ||
426 | wacom->serial[1] = (data[7] & 0x38 ) >> 2; | ||
427 | |||
428 | /* don't alter the value when there is no wheel event */ | ||
429 | if (wacom->serial[1] == 1) | ||
430 | wacom->serial[1] = 0; | ||
431 | rw = wacom->serial[1]; | ||
432 | rw = (rw & 0x08) ? -(rw & 0x07) : (rw & 0x07); | ||
433 | input_report_rel(dev, REL_WHEEL, rw); | 447 | input_report_rel(dev, REL_WHEEL, rw); |
434 | wacom->tool[1] = BTN_TOOL_FINGER; | 448 | input_report_key(dev, BTN_TOOL_FINGER, 0xf0); |
435 | wacom->id[1] = data[7] & 0xf8; | ||
436 | input_report_key(dev, wacom->tool[1], 0xf0); | ||
437 | input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); | 449 | input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); |
438 | } else if (wacom->id[1]) { | 450 | } else if (wacom->id[1]) { |
439 | wacom->id[1] = 0; | 451 | wacom->id[1] = 0; |
440 | wacom->serial[1] = 0; | 452 | input_report_key(dev, BTN_TOOL_FINGER, 0); |
441 | input_report_key(dev, wacom->tool[1], 0); | ||
442 | input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); | 453 | input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); |
443 | } | 454 | } |
444 | input_sync(dev); | 455 | input_sync(dev); |
@@ -516,21 +527,31 @@ static int wacom_intuos_inout(struct urb *urb) | |||
516 | default: /* Unknown tool */ | 527 | default: /* Unknown tool */ |
517 | wacom->tool[idx] = BTN_TOOL_PEN; | 528 | wacom->tool[idx] = BTN_TOOL_PEN; |
518 | } | 529 | } |
519 | input_report_key(dev, wacom->tool[idx], wacom->id[idx]); | 530 | if(!((wacom->tool[idx] == BTN_TOOL_LENS) && |
520 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 531 | ((wacom->features->type == INTUOS312) |
521 | input_sync(dev); | 532 | || (wacom->features->type == INTUOS319)))) { |
533 | input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */ | ||
534 | input_report_key(dev, wacom->tool[idx], 1); | ||
535 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | ||
536 | input_sync(dev); | ||
537 | } | ||
522 | return 1; | 538 | return 1; |
523 | } | 539 | } |
524 | 540 | ||
525 | /* Exit report */ | 541 | /* Exit report */ |
526 | if ((data[1] & 0xfe) == 0x80) { | 542 | if ((data[1] & 0xfe) == 0x80) { |
527 | input_report_key(dev, wacom->tool[idx], 0); | 543 | input_report_key(dev, wacom->tool[idx], 0); |
544 | input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ | ||
528 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 545 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
529 | input_sync(dev); | 546 | input_sync(dev); |
530 | return 1; | 547 | return 1; |
531 | } | 548 | } |
532 | 549 | ||
533 | return 0; | 550 | if((wacom->tool[idx] == BTN_TOOL_LENS) && ((wacom->features->type == INTUOS312) |
551 | || (wacom->features->type == INTUOS319))) | ||
552 | return 1; | ||
553 | else | ||
554 | return 0; | ||
534 | } | 555 | } |
535 | 556 | ||
536 | static void wacom_intuos_general(struct urb *urb) | 557 | static void wacom_intuos_general(struct urb *urb) |
@@ -600,10 +621,9 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
600 | /* pad packets. Works as a second tool and is always in prox */ | 621 | /* pad packets. Works as a second tool and is always in prox */ |
601 | if (data[0] == 12) { | 622 | if (data[0] == 12) { |
602 | /* initiate the pad as a device */ | 623 | /* initiate the pad as a device */ |
603 | if (wacom->tool[1] != BTN_TOOL_FINGER) { | 624 | if (wacom->tool[1] != BTN_TOOL_FINGER) |
604 | wacom->tool[1] = BTN_TOOL_FINGER; | 625 | wacom->tool[1] = BTN_TOOL_FINGER; |
605 | input_report_key(dev, wacom->tool[1], 1); | 626 | |
606 | } | ||
607 | input_report_key(dev, BTN_0, (data[5] & 0x01)); | 627 | input_report_key(dev, BTN_0, (data[5] & 0x01)); |
608 | input_report_key(dev, BTN_1, (data[5] & 0x02)); | 628 | input_report_key(dev, BTN_1, (data[5] & 0x02)); |
609 | input_report_key(dev, BTN_2, (data[5] & 0x04)); | 629 | input_report_key(dev, BTN_2, (data[5] & 0x04)); |
@@ -614,6 +634,11 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
614 | input_report_key(dev, BTN_7, (data[6] & 0x08)); | 634 | input_report_key(dev, BTN_7, (data[6] & 0x08)); |
615 | input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); | 635 | input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); |
616 | input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); | 636 | input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); |
637 | |||
638 | if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) | data[2]) | ||
639 | input_report_key(dev, wacom->tool[1], 1); | ||
640 | else | ||
641 | input_report_key(dev, wacom->tool[1], 0); | ||
617 | input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff); | 642 | input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff); |
618 | input_sync(dev); | 643 | input_sync(dev); |
619 | goto exit; | 644 | goto exit; |
@@ -676,8 +701,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
676 | input_report_key(dev, BTN_LEFT, data[8] & 0x04); | 701 | input_report_key(dev, BTN_LEFT, data[8] & 0x04); |
677 | input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); | 702 | input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); |
678 | input_report_key(dev, BTN_RIGHT, data[8] & 0x10); | 703 | input_report_key(dev, BTN_RIGHT, data[8] & 0x10); |
679 | input_report_rel(dev, REL_WHEEL, ((data[8] & 0x02) >> 1) | 704 | input_report_rel(dev, REL_WHEEL, (data[8] & 0x01) |
680 | - (data[8] & 0x01)); | 705 | - ((data[8] & 0x02) >> 1)); |
681 | 706 | ||
682 | /* I3 2D mouse side buttons */ | 707 | /* I3 2D mouse side buttons */ |
683 | if (wacom->features->type == INTUOS3) { | 708 | if (wacom->features->type == INTUOS3) { |
@@ -695,7 +720,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
695 | } | 720 | } |
696 | } | 721 | } |
697 | 722 | ||
698 | input_report_key(dev, wacom->tool[idx], wacom->id[idx]); | 723 | input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */ |
724 | input_report_key(dev, wacom->tool[idx], 1); | ||
699 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 725 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
700 | input_sync(dev); | 726 | input_sync(dev); |
701 | 727 | ||
@@ -733,7 +759,8 @@ static struct wacom_features wacom_features[] = { | |||
733 | { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq }, | 759 | { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq }, |
734 | { "Wacom PL700", 8, 6758, 5406, 511, 32, PL, wacom_pl_irq }, | 760 | { "Wacom PL700", 8, 6758, 5406, 511, 32, PL, wacom_pl_irq }, |
735 | { "Wacom PL510", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq }, | 761 | { "Wacom PL510", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq }, |
736 | { "Wacom PL710", 8, 34080, 27660, 511, 32, PL, wacom_pl_irq }, | 762 | { "Wacom DTU710", 8, 34080, 27660, 511, 32, PL, wacom_pl_irq }, |
763 | { "Wacom DTF521", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq }, | ||
737 | { "Wacom DTF720", 8, 6858, 5506, 511, 32, PL, wacom_pl_irq }, | 764 | { "Wacom DTF720", 8, 6858, 5506, 511, 32, PL, wacom_pl_irq }, |
738 | { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, | 765 | { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, |
739 | { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, | 766 | { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, |
@@ -744,6 +771,8 @@ static struct wacom_features wacom_features[] = { | |||
744 | { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq }, | 771 | { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq }, |
745 | { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq }, | 772 | { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq }, |
746 | { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq }, | 773 | { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq }, |
774 | { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 15, INTUOS312, wacom_intuos_irq }, | ||
775 | { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 15, INTUOS319, wacom_intuos_irq }, | ||
747 | { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 15, INTUOS3, wacom_intuos_irq }, | 776 | { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 15, INTUOS3, wacom_intuos_irq }, |
748 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq }, | 777 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq }, |
749 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, | 778 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, |
@@ -779,6 +808,7 @@ static struct usb_device_id wacom_ids[] = { | |||
779 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, | 808 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, |
780 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, | 809 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, |
781 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) }, | 810 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) }, |
811 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC3) }, | ||
782 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, | 812 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, |
783 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, | 813 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, |
784 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, | 814 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, |
@@ -788,6 +818,8 @@ static struct usb_device_id wacom_ids[] = { | |||
788 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, | 818 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, |
789 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, | 819 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, |
790 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, | 820 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, |
821 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB3) }, | ||
822 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) }, | ||
791 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, | 823 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, |
792 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, | 824 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, |
793 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, | 825 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, |
@@ -820,7 +852,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
820 | struct usb_endpoint_descriptor *endpoint; | 852 | struct usb_endpoint_descriptor *endpoint; |
821 | struct wacom *wacom; | 853 | struct wacom *wacom; |
822 | struct input_dev *input_dev; | 854 | struct input_dev *input_dev; |
823 | char rep_data[2] = {0x02, 0x02}; | 855 | char rep_data[2], limit = 0; |
824 | 856 | ||
825 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); | 857 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); |
826 | input_dev = input_allocate_device(); | 858 | input_dev = input_allocate_device(); |
@@ -857,6 +889,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
857 | input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0); | 889 | input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0); |
858 | input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); | 890 | input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); |
859 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); | 891 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); |
892 | input_dev->absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC); | ||
860 | 893 | ||
861 | switch (wacom->features->type) { | 894 | switch (wacom->features->type) { |
862 | case WACOM_G4: | 895 | case WACOM_G4: |
@@ -875,6 +908,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
875 | break; | 908 | break; |
876 | 909 | ||
877 | case INTUOS3: | 910 | case INTUOS3: |
911 | case INTUOS312: | ||
912 | case INTUOS319: | ||
878 | case CINTIQ: | 913 | case CINTIQ: |
879 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); | 914 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); |
880 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); | 915 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); |
@@ -916,10 +951,13 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
916 | 951 | ||
917 | input_register_device(wacom->dev); | 952 | input_register_device(wacom->dev); |
918 | 953 | ||
919 | /* ask the tablet to report tablet data */ | 954 | /* Ask the tablet to report tablet data. Repeat until it succeeds */ |
920 | usb_set_report(intf, 3, 2, rep_data, 2); | 955 | do { |
921 | /* repeat once (not sure why the first call often fails) */ | 956 | rep_data[0] = 2; |
922 | usb_set_report(intf, 3, 2, rep_data, 2); | 957 | rep_data[1] = 2; |
958 | usb_set_report(intf, 3, 2, rep_data, 2); | ||
959 | usb_get_report(intf, 3, 2, rep_data, 2); | ||
960 | } while (rep_data[1] != 2 && limit++ < 5); | ||
923 | 961 | ||
924 | usb_set_intfdata(intf, wacom); | 962 | usb_set_intfdata(intf, wacom); |
925 | return 0; | 963 | return 0; |