aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c68
1 files changed, 41 insertions, 27 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 08ba5ad9c9be..03ebcc8b24b5 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -15,6 +15,7 @@
15#include "wacom_wac.h" 15#include "wacom_wac.h"
16#include "wacom.h" 16#include "wacom.h"
17#include <linux/input/mt.h> 17#include <linux/input/mt.h>
18#include <linux/hid.h>
18 19
19/* resolution for penabled devices */ 20/* resolution for penabled devices */
20#define WACOM_PL_RES 20 21#define WACOM_PL_RES 20
@@ -264,6 +265,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
264 wacom->id[0] = 0; 265 wacom->id[0] = 0;
265 input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ 266 input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
266 input_report_key(input, wacom->tool[0], prox); 267 input_report_key(input, wacom->tool[0], prox);
268 input_event(input, EV_MSC, MSC_SERIAL, 1);
267 input_sync(input); /* sync last event */ 269 input_sync(input); /* sync last event */
268 } 270 }
269 271
@@ -273,11 +275,10 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
273 prox = data[7] & 0xf8; 275 prox = data[7] & 0xf8;
274 if (prox || wacom->id[1]) { 276 if (prox || wacom->id[1]) {
275 wacom->id[1] = PAD_DEVICE_ID; 277 wacom->id[1] = PAD_DEVICE_ID;
276 input_report_key(input, BTN_0, (data[7] & 0x40)); 278 input_report_key(input, BTN_BACK, (data[7] & 0x40));
277 input_report_key(input, BTN_4, (data[7] & 0x80)); 279 input_report_key(input, BTN_FORWARD, (data[7] & 0x80));
278 rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); 280 rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
279 input_report_rel(input, REL_WHEEL, rw); 281 input_report_rel(input, REL_WHEEL, rw);
280 input_report_key(input, BTN_TOOL_FINGER, 0xf0);
281 if (!prox) 282 if (!prox)
282 wacom->id[1] = 0; 283 wacom->id[1] = 0;
283 input_report_abs(input, ABS_MISC, wacom->id[1]); 284 input_report_abs(input, ABS_MISC, wacom->id[1]);
@@ -290,18 +291,17 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
290 prox = (data[7] & 0xf8) || data[8]; 291 prox = (data[7] & 0xf8) || data[8];
291 if (prox || wacom->id[1]) { 292 if (prox || wacom->id[1]) {
292 wacom->id[1] = PAD_DEVICE_ID; 293 wacom->id[1] = PAD_DEVICE_ID;
293 input_report_key(input, BTN_0, (data[7] & 0x08)); 294 input_report_key(input, BTN_BACK, (data[7] & 0x08));
294 input_report_key(input, BTN_1, (data[7] & 0x20)); 295 input_report_key(input, BTN_LEFT, (data[7] & 0x20));
295 input_report_key(input, BTN_4, (data[7] & 0x10)); 296 input_report_key(input, BTN_FORWARD, (data[7] & 0x10));
296 input_report_key(input, BTN_5, (data[7] & 0x40)); 297 input_report_key(input, BTN_RIGHT, (data[7] & 0x40));
297 input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f)); 298 input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f));
298 input_report_key(input, BTN_TOOL_FINGER, 0xf0);
299 if (!prox) 299 if (!prox)
300 wacom->id[1] = 0; 300 wacom->id[1] = 0;
301 input_report_abs(input, ABS_MISC, wacom->id[1]); 301 input_report_abs(input, ABS_MISC, wacom->id[1]);
302 input_event(input, EV_MSC, MSC_SERIAL, 0xf0); 302 input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
303 retval = 1;
303 } 304 }
304 retval = 1;
305 break; 305 break;
306 } 306 }
307exit: 307exit:
@@ -494,10 +494,6 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
494 494
495 /* pad packets. Works as a second tool and is always in prox */ 495 /* pad packets. Works as a second tool and is always in prox */
496 if (data[0] == WACOM_REPORT_INTUOSPAD) { 496 if (data[0] == WACOM_REPORT_INTUOSPAD) {
497 /* initiate the pad as a device */
498 if (wacom->tool[1] != BTN_TOOL_FINGER)
499 wacom->tool[1] = BTN_TOOL_FINGER;
500
501 if (features->type >= INTUOS4S && features->type <= INTUOS4L) { 497 if (features->type >= INTUOS4S && features->type <= INTUOS4L) {
502 input_report_key(input, BTN_0, (data[2] & 0x01)); 498 input_report_key(input, BTN_0, (data[2] & 0x01));
503 input_report_key(input, BTN_1, (data[3] & 0x01)); 499 input_report_key(input, BTN_1, (data[3] & 0x01));
@@ -1080,18 +1076,14 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1080 1076
1081 switch (wacom_wac->features.type) { 1077 switch (wacom_wac->features.type) {
1082 case WACOM_MO: 1078 case WACOM_MO:
1083 __set_bit(BTN_1, input_dev->keybit);
1084 __set_bit(BTN_5, input_dev->keybit);
1085
1086 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); 1079 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
1087 /* fall through */ 1080 /* fall through */
1088 1081
1089 case WACOM_G4: 1082 case WACOM_G4:
1090 input_set_capability(input_dev, EV_MSC, MSC_SERIAL); 1083 input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
1091 1084
1092 __set_bit(BTN_TOOL_FINGER, input_dev->keybit); 1085 __set_bit(BTN_BACK, input_dev->keybit);
1093 __set_bit(BTN_0, input_dev->keybit); 1086 __set_bit(BTN_FORWARD, input_dev->keybit);
1094 __set_bit(BTN_4, input_dev->keybit);
1095 /* fall through */ 1087 /* fall through */
1096 1088
1097 case GRAPHIRE: 1089 case GRAPHIRE:
@@ -1127,10 +1119,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1127 case CINTIQ: 1119 case CINTIQ:
1128 for (i = 0; i < 8; i++) 1120 for (i = 0; i < 8; i++)
1129 __set_bit(BTN_0 + i, input_dev->keybit); 1121 __set_bit(BTN_0 + i, input_dev->keybit);
1130 __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1131 1122
1132 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); 1123 if (wacom_wac->features.type != WACOM_21UX2) {
1133 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); 1124 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1125 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1126 }
1127
1134 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1128 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1135 wacom_setup_cintiq(wacom_wac); 1129 wacom_setup_cintiq(wacom_wac);
1136 break; 1130 break;
@@ -1151,8 +1145,6 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1151 __set_bit(BTN_2, input_dev->keybit); 1145 __set_bit(BTN_2, input_dev->keybit);
1152 __set_bit(BTN_3, input_dev->keybit); 1146 __set_bit(BTN_3, input_dev->keybit);
1153 1147
1154 __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1155
1156 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); 1148 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1157 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1149 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1158 /* fall through */ 1150 /* fall through */
@@ -1170,7 +1162,6 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1170 case INTUOS4S: 1162 case INTUOS4S:
1171 for (i = 0; i < 7; i++) 1163 for (i = 0; i < 7; i++)
1172 __set_bit(BTN_0 + i, input_dev->keybit); 1164 __set_bit(BTN_0 + i, input_dev->keybit);
1173 __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1174 1165
1175 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1166 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1176 wacom_setup_intuos(wacom_wac); 1167 wacom_setup_intuos(wacom_wac);
@@ -1295,6 +1286,12 @@ static const struct wacom_features wacom_features_0x65 =
1295static const struct wacom_features wacom_features_0x69 = 1286static const struct wacom_features wacom_features_0x69 =
1296 { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 1287 { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
1297 63, GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; 1288 63, GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
1289static const struct wacom_features wacom_features_0x6A =
1290 { "Wacom Bamboo1 4x6", WACOM_PKGLEN_GRAPHIRE, 14760, 9225, 1023,
1291 63, GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1292static const struct wacom_features wacom_features_0x6B =
1293 { "Wacom Bamboo1 5x8", WACOM_PKGLEN_GRAPHIRE, 21648, 13530, 1023,
1294 63, GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1298static const struct wacom_features wacom_features_0x20 = 1295static const struct wacom_features wacom_features_0x20 =
1299 { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, 1296 { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,
1300 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1297 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -1427,6 +1424,9 @@ static const struct wacom_features wacom_features_0x90 =
1427static const struct wacom_features wacom_features_0x93 = 1424static const struct wacom_features wacom_features_0x93 =
1428 { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 1425 { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1429 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1426 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1427static const struct wacom_features wacom_features_0x97 =
1428 { "Wacom ISDv4 97", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 511,
1429 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1430static const struct wacom_features wacom_features_0x9A = 1430static const struct wacom_features wacom_features_0x9A =
1431 { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 1431 { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1432 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1432 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -1458,7 +1458,7 @@ static const struct wacom_features wacom_features_0xD3 =
1458 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 1458 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,
1459 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1459 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1460static const struct wacom_features wacom_features_0xD4 = 1460static const struct wacom_features wacom_features_0xD4 =
1461 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255, 1461 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1462 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1462 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1463static const struct wacom_features wacom_features_0xD6 = 1463static const struct wacom_features wacom_features_0xD6 =
1464 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1464 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
@@ -1483,6 +1483,11 @@ static const struct wacom_features wacom_features_0x6004 =
1483 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ 1483 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
1484 .driver_info = (kernel_ulong_t)&wacom_features_##prod 1484 .driver_info = (kernel_ulong_t)&wacom_features_##prod
1485 1485
1486#define USB_DEVICE_DETAILED(prod, class, sub, proto) \
1487 USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_WACOM, prod, class, \
1488 sub, proto), \
1489 .driver_info = (kernel_ulong_t)&wacom_features_##prod
1490
1486#define USB_DEVICE_LENOVO(prod) \ 1491#define USB_DEVICE_LENOVO(prod) \
1487 USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \ 1492 USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \
1488 .driver_info = (kernel_ulong_t)&wacom_features_##prod 1493 .driver_info = (kernel_ulong_t)&wacom_features_##prod
@@ -1506,6 +1511,8 @@ const struct usb_device_id wacom_ids[] = {
1506 { USB_DEVICE_WACOM(0x64) }, 1511 { USB_DEVICE_WACOM(0x64) },
1507 { USB_DEVICE_WACOM(0x65) }, 1512 { USB_DEVICE_WACOM(0x65) },
1508 { USB_DEVICE_WACOM(0x69) }, 1513 { USB_DEVICE_WACOM(0x69) },
1514 { USB_DEVICE_WACOM(0x6A) },
1515 { USB_DEVICE_WACOM(0x6B) },
1509 { USB_DEVICE_WACOM(0x20) }, 1516 { USB_DEVICE_WACOM(0x20) },
1510 { USB_DEVICE_WACOM(0x21) }, 1517 { USB_DEVICE_WACOM(0x21) },
1511 { USB_DEVICE_WACOM(0x22) }, 1518 { USB_DEVICE_WACOM(0x22) },
@@ -1545,7 +1552,13 @@ const struct usb_device_id wacom_ids[] = {
1545 { USB_DEVICE_WACOM(0xC5) }, 1552 { USB_DEVICE_WACOM(0xC5) },
1546 { USB_DEVICE_WACOM(0xC6) }, 1553 { USB_DEVICE_WACOM(0xC6) },
1547 { USB_DEVICE_WACOM(0xC7) }, 1554 { USB_DEVICE_WACOM(0xC7) },
1548 { USB_DEVICE_WACOM(0xCE) }, 1555 /*
1556 * DTU-2231 has two interfaces on the same configuration,
1557 * only one is used.
1558 */
1559 { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID,
1560 USB_INTERFACE_SUBCLASS_BOOT,
1561 USB_INTERFACE_PROTOCOL_MOUSE) },
1549 { USB_DEVICE_WACOM(0xD0) }, 1562 { USB_DEVICE_WACOM(0xD0) },
1550 { USB_DEVICE_WACOM(0xD1) }, 1563 { USB_DEVICE_WACOM(0xD1) },
1551 { USB_DEVICE_WACOM(0xD2) }, 1564 { USB_DEVICE_WACOM(0xD2) },
@@ -1560,6 +1573,7 @@ const struct usb_device_id wacom_ids[] = {
1560 { USB_DEVICE_WACOM(0xCC) }, 1573 { USB_DEVICE_WACOM(0xCC) },
1561 { USB_DEVICE_WACOM(0x90) }, 1574 { USB_DEVICE_WACOM(0x90) },
1562 { USB_DEVICE_WACOM(0x93) }, 1575 { USB_DEVICE_WACOM(0x93) },
1576 { USB_DEVICE_WACOM(0x97) },
1563 { USB_DEVICE_WACOM(0x9A) }, 1577 { USB_DEVICE_WACOM(0x9A) },
1564 { USB_DEVICE_WACOM(0x9F) }, 1578 { USB_DEVICE_WACOM(0x9F) },
1565 { USB_DEVICE_WACOM(0xE2) }, 1579 { USB_DEVICE_WACOM(0xE2) },