aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPing Cheng <pingc@wacom.com>2007-06-14 23:32:48 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-07-10 00:35:17 -0400
commit7ecfbfd3d000a5d6787cf3369228e7f0082b8758 (patch)
tree8df68e50be4e668657bef51efde4c2ce8d3a3221 /drivers
parent5f5655023f2814969b744c1e07494666587243aa (diff)
Input: wacom - add support for the new Bamboo tablets
Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/tablet/wacom.h8
-rw-r--r--drivers/input/tablet/wacom_sys.c6
-rw-r--r--drivers/input/tablet/wacom_wac.c47
-rw-r--r--drivers/input/tablet/wacom_wac.h1
4 files changed, 53 insertions, 9 deletions
diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index ef01a807ec0..6542edb6f76 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -11,7 +11,7 @@
11 * Copyright (c) 2000 Daniel Egger <egger@suse.de> 11 * Copyright (c) 2000 Daniel Egger <egger@suse.de>
12 * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com> 12 * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
13 * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> 13 * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
14 * Copyright (c) 2002-2006 Ping Cheng <pingc@wacom.com> 14 * Copyright (c) 2002-2007 Ping Cheng <pingc@wacom.com>
15 * 15 *
16 * ChangeLog: 16 * ChangeLog:
17 * v0.1 (vp) - Initial release 17 * v0.1 (vp) - Initial release
@@ -62,8 +62,9 @@
62 * - Minor data report fix 62 * - Minor data report fix
63 * v1.46 (pc) - Split wacom.c into wacom_sys.c and wacom_wac.c, 63 * v1.46 (pc) - Split wacom.c into wacom_sys.c and wacom_wac.c,
64 * - where wacom_sys.c deals with system specific code, 64 * - where wacom_sys.c deals with system specific code,
65 * - and wacom_wac.c deals with Wacom specific code 65 * - and wacom_wac.c deals with Wacom specific code
66 * - Support Intuos3 4x6 66 * - Support Intuos3 4x6
67 * v1.47 (pc) - Added support for Bamboo
67 */ 68 */
68 69
69/* 70/*
@@ -84,7 +85,7 @@
84/* 85/*
85 * Version Information 86 * Version Information
86 */ 87 */
87#define DRIVER_VERSION "v1.46" 88#define DRIVER_VERSION "v1.47"
88#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" 89#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
89#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" 90#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
90#define DRIVER_LICENSE "GPL" 91#define DRIVER_LICENSE "GPL"
@@ -123,6 +124,7 @@ extern void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wa
123extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac); 124extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
124extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac); 125extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
125extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac); 126extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
127extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
126extern __u16 wacom_le16_to_cpu(unsigned char *data); 128extern __u16 wacom_le16_to_cpu(unsigned char *data);
127extern __u16 wacom_be16_to_cpu(unsigned char *data); 129extern __u16 wacom_be16_to_cpu(unsigned char *data);
128extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id); 130extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id);
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 83bddef6606..064e123c9b7 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -138,6 +138,12 @@ static void wacom_close(struct input_dev *dev)
138 usb_kill_urb(wacom->irq); 138 usb_kill_urb(wacom->irq);
139} 139}
140 140
141void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
142{
143 input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_1) | BIT(BTN_5);
144 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
145}
146
141void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 147void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
142{ 148{
143 input_dev->evbit[0] |= BIT(EV_MSC); 149 input_dev->evbit[0] |= BIT(EV_MSC);
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 7661f03a2db..fc03ba256f4 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -178,7 +178,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
178 178
179 case 2: /* Mouse with wheel */ 179 case 2: /* Mouse with wheel */
180 wacom_report_key(wcombo, BTN_MIDDLE, data[1] & 0x04); 180 wacom_report_key(wcombo, BTN_MIDDLE, data[1] & 0x04);
181 if (wacom->features->type == WACOM_G4) { 181 if (wacom->features->type == WACOM_G4 ||
182 wacom->features->type == WACOM_MO) {
182 rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : (data[7] & 0x03); 183 rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : (data[7] & 0x03);
183 wacom_report_rel(wcombo, REL_WHEEL, -rw); 184 wacom_report_rel(wcombo, REL_WHEEL, -rw);
184 } else 185 } else
@@ -190,7 +191,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
190 id = CURSOR_DEVICE_ID; 191 id = CURSOR_DEVICE_ID;
191 wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01); 192 wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01);
192 wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02); 193 wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02);
193 if (wacom->features->type == WACOM_G4) 194 if (wacom->features->type == WACOM_G4 ||
195 wacom->features->type == WACOM_MO)
194 wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f); 196 wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f);
195 else 197 else
196 wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f); 198 wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f);
@@ -226,7 +228,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
226 } 228 }
227 229
228 /* send pad data */ 230 /* send pad data */
229 if (wacom->features->type == WACOM_G4) { 231 switch (wacom->features->type) {
232 case WACOM_G4:
230 if (data[7] & 0xf8) { 233 if (data[7] & 0xf8) {
231 wacom_input_sync(wcombo); /* sync last event */ 234 wacom_input_sync(wcombo); /* sync last event */
232 wacom->id[1] = 1; 235 wacom->id[1] = 1;
@@ -247,6 +250,33 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
247 wacom_report_abs(wcombo, ABS_MISC, 0); 250 wacom_report_abs(wcombo, ABS_MISC, 0);
248 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); 251 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
249 } 252 }
253 break;
254 case WACOM_MO:
255 if ((data[7] & 0xf8) || (data[8] & 0x80)) {
256 wacom_input_sync(wcombo); /* sync last event */
257 wacom->id[1] = 1;
258 wacom->serial[1] = (data[7] & 0xf8);
259 wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
260 wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
261 wacom_report_key(wcombo, BTN_4, (data[7] & 0x10));
262 wacom_report_key(wcombo, BTN_5, (data[7] & 0x40));
263 wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f));
264 wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0);
265 wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
266 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
267 } else if (wacom->id[1]) {
268 wacom_input_sync(wcombo); /* sync last event */
269 wacom->id[1] = 0;
270 wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
271 wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
272 wacom_report_key(wcombo, BTN_4, (data[7] & 0x10));
273 wacom_report_key(wcombo, BTN_5, (data[7] & 0x40));
274 wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f));
275 wacom_report_key(wcombo, BTN_TOOL_FINGER, 0);
276 wacom_report_abs(wcombo, ABS_MISC, 0);
277 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
278 }
279 break;
250 } 280 }
251 return 1; 281 return 1;
252} 282}
@@ -331,7 +361,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
331 wacom_report_key(wcombo, BTN_EXTRA, 0); 361 wacom_report_key(wcombo, BTN_EXTRA, 0);
332 wacom_report_abs(wcombo, ABS_THROTTLE, 0); 362 wacom_report_abs(wcombo, ABS_THROTTLE, 0);
333 wacom_report_abs(wcombo, ABS_RZ, 0); 363 wacom_report_abs(wcombo, ABS_RZ, 0);
334 } else { 364 } else {
335 wacom_report_abs(wcombo, ABS_PRESSURE, 0); 365 wacom_report_abs(wcombo, ABS_PRESSURE, 0);
336 wacom_report_abs(wcombo, ABS_TILT_X, 0); 366 wacom_report_abs(wcombo, ABS_TILT_X, 0);
337 wacom_report_abs(wcombo, ABS_TILT_Y, 0); 367 wacom_report_abs(wcombo, ABS_TILT_Y, 0);
@@ -423,9 +453,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
423 return result-1; 453 return result-1;
424 454
425 /* Only large I3 and I1 & I2 support Lense Cursor */ 455 /* Only large I3 and I1 & I2 support Lense Cursor */
426 if((wacom->tool[idx] == BTN_TOOL_LENS) 456 if ((wacom->tool[idx] == BTN_TOOL_LENS)
427 && ((wacom->features->type == INTUOS3) 457 && ((wacom->features->type == INTUOS3)
428 || (wacom->features->type == INTUOS3S))) 458 || (wacom->features->type == INTUOS3S)))
429 return 0; 459 return 0;
430 460
431 /* Cintiq doesn't send data when RDY bit isn't set */ 461 /* Cintiq doesn't send data when RDY bit isn't set */
@@ -517,6 +547,7 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
517 break; 547 break;
518 case WACOM_G4: 548 case WACOM_G4:
519 case GRAPHIRE: 549 case GRAPHIRE:
550 case WACOM_MO:
520 return (wacom_graphire_irq(wacom_wac, wcombo)); 551 return (wacom_graphire_irq(wacom_wac, wcombo));
521 break; 552 break;
522 case PTU: 553 case PTU:
@@ -538,6 +569,8 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
538void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 569void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
539{ 570{
540 switch (wacom_wac->features->type) { 571 switch (wacom_wac->features->type) {
572 case WACOM_MO:
573 input_dev_mo(input_dev, wacom_wac);
541 case WACOM_G4: 574 case WACOM_G4:
542 input_dev_g4(input_dev, wacom_wac); 575 input_dev_g4(input_dev, wacom_wac);
543 /* fall through */ 576 /* fall through */
@@ -579,6 +612,7 @@ static struct wacom_features wacom_features[] = {
579 { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE }, 612 { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE },
580 { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 63, GRAPHIRE }, 613 { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 63, GRAPHIRE },
581 { "Wacom PenPartner2", 8, 3250, 2320, 255, 63, GRAPHIRE }, 614 { "Wacom PenPartner2", 8, 3250, 2320, 255, 63, GRAPHIRE },
615 { "Wacom Bamboo", 9, 14760, 9225, 511, 63, WACOM_MO },
582 { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS }, 616 { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS },
583 { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, 617 { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
584 { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 31, INTUOS }, 618 { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 31, INTUOS },
@@ -627,6 +661,7 @@ static struct usb_device_id wacom_ids[] = {
627 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, 661 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) },
628 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x63) }, 662 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x63) },
629 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) }, 663 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) },
664 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x65) },
630 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) }, 665 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
631 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) }, 666 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) },
632 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) }, 667 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) },
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index a5e12e8756d..a302e229bb8 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -25,6 +25,7 @@ enum {
25 INTUOS3, 25 INTUOS3,
26 INTUOS3L, 26 INTUOS3L,
27 CINTIQ, 27 CINTIQ,
28 WACOM_MO,
28 MAX_TYPE 29 MAX_TYPE
29}; 30};
30 31