aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2012-04-03 18:50:40 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-04-04 12:25:42 -0400
commitae584ca473289377dd7fd8c61439db4bfab5489a (patch)
tree844fa2f4aac8de7ddc72066247f7a3c04eec6443 /drivers/input/tablet
parent9b5b95dd516a13d53ecf9217672d2116f05097bc (diff)
Input: wacom - add Intuos5 multitouch sensor support
Intuos5 tablets with PTH-* model numbers include a multitouch sensor which use the same touch reports as the 3rd-generation Bamboo. No useful information is in the HID descriptor for the touch interface so hardcoded values are used during setup. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Reviewed-by: Chris Bagwell <chris@cnpbagwell.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/wacom_sys.c25
-rw-r--r--drivers/input/tablet/wacom_wac.c64
2 files changed, 84 insertions, 5 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index d7713388a953..1c874adb7053 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -233,6 +233,9 @@ static int wacom_parse_logical_collection(unsigned char *report,
233 * 3rd gen Bamboo Touch no longer define a Digitizer-Finger Pysical 233 * 3rd gen Bamboo Touch no longer define a Digitizer-Finger Pysical
234 * Collection. Instead they define a Logical Collection with a single 234 * Collection. Instead they define a Logical Collection with a single
235 * Logical Maximum for both X and Y. 235 * Logical Maximum for both X and Y.
236 *
237 * Intuos5 touch interface does not contain useful data. We deal with
238 * this after returning from this function.
236 */ 239 */
237static int wacom_parse_hid(struct usb_interface *intf, 240static int wacom_parse_hid(struct usb_interface *intf,
238 struct hid_descriptor *hid_desc, 241 struct hid_descriptor *hid_desc,
@@ -1085,6 +1088,28 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
1085 if (error) 1088 if (error)
1086 goto fail3; 1089 goto fail3;
1087 1090
1091 /*
1092 * Intuos5 has no useful data about its touch interface in its
1093 * HID descriptor. If this is the touch interface (wMaxPacketSize
1094 * of WACOM_PKGLEN_BBTOUCH3), override the table values.
1095 */
1096 if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
1097 if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
1098 features->device_type = BTN_TOOL_FINGER;
1099 features->pktlen = WACOM_PKGLEN_BBTOUCH3;
1100
1101 features->x_phy =
1102 (features->x_max * 100) / features->x_resolution;
1103 features->y_phy =
1104 (features->y_max * 100) / features->y_resolution;
1105
1106 features->x_max = 4096;
1107 features->y_max = 4096;
1108 } else {
1109 features->device_type = BTN_TOOL_PEN;
1110 }
1111 }
1112
1088 wacom_setup_device_quirks(features); 1113 wacom_setup_device_quirks(features);
1089 1114
1090 strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); 1115 strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index f4a9efd393c9..a6173431d803 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -321,6 +321,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
321 321
322 /* Enter report */ 322 /* Enter report */
323 if ((data[1] & 0xfc) == 0xc0) { 323 if ((data[1] & 0xfc) == 0xc0) {
324 if (features->type >= INTUOS5S && features->type <= INTUOS5L)
325 wacom->shared->stylus_in_proximity = true;
326
324 /* serial number of the tool */ 327 /* serial number of the tool */
325 wacom->serial[idx] = ((data[3] & 0x0f) << 28) + 328 wacom->serial[idx] = ((data[3] & 0x0f) << 28) +
326 (data[4] << 20) + (data[5] << 12) + 329 (data[4] << 20) + (data[5] << 12) +
@@ -406,6 +409,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
406 409
407 /* Exit report */ 410 /* Exit report */
408 if ((data[1] & 0xfe) == 0x80) { 411 if ((data[1] & 0xfe) == 0x80) {
412 if (features->type >= INTUOS5S && features->type <= INTUOS5L)
413 wacom->shared->stylus_in_proximity = false;
414
409 /* 415 /*
410 * Reset all states otherwise we lose the initial states 416 * Reset all states otherwise we lose the initial states
411 * when in-prox next time 417 * when in-prox next time
@@ -1140,9 +1146,6 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1140 case INTUOS4S: 1146 case INTUOS4S:
1141 case INTUOS4: 1147 case INTUOS4:
1142 case INTUOS4L: 1148 case INTUOS4L:
1143 case INTUOS5S:
1144 case INTUOS5:
1145 case INTUOS5L:
1146 case CINTIQ: 1149 case CINTIQ:
1147 case WACOM_BEE: 1150 case WACOM_BEE:
1148 case WACOM_21UX2: 1151 case WACOM_21UX2:
@@ -1150,6 +1153,15 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1150 sync = wacom_intuos_irq(wacom_wac); 1153 sync = wacom_intuos_irq(wacom_wac);
1151 break; 1154 break;
1152 1155
1156 case INTUOS5S:
1157 case INTUOS5:
1158 case INTUOS5L:
1159 if (len == WACOM_PKGLEN_BBTOUCH3)
1160 sync = wacom_bpt3_touch(wacom_wac);
1161 else
1162 sync = wacom_intuos_irq(wacom_wac);
1163 break;
1164
1153 case TABLETPC: 1165 case TABLETPC:
1154 case TABLETPC2FG: 1166 case TABLETPC2FG:
1155 sync = wacom_tpc_irq(wacom_wac, len); 1167 sync = wacom_tpc_irq(wacom_wac, len);
@@ -1224,7 +1236,8 @@ void wacom_setup_device_quirks(struct wacom_features *features)
1224 1236
1225 /* these device have multiple inputs */ 1237 /* these device have multiple inputs */
1226 if (features->type == TABLETPC || features->type == TABLETPC2FG || 1238 if (features->type == TABLETPC || features->type == TABLETPC2FG ||
1227 features->type == BAMBOO_PT || features->type == WIRELESS) 1239 features->type == BAMBOO_PT || features->type == WIRELESS ||
1240 (features->type >= INTUOS5S && features->type <= INTUOS5L))
1228 features->quirks |= WACOM_QUIRK_MULTI_INPUT; 1241 features->quirks |= WACOM_QUIRK_MULTI_INPUT;
1229 1242
1230 /* quirk for bamboo touch with 2 low res touches */ 1243 /* quirk for bamboo touch with 2 low res touches */
@@ -1393,13 +1406,54 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1393 1406
1394 case INTUOS5: 1407 case INTUOS5:
1395 case INTUOS5L: 1408 case INTUOS5L:
1409 if (features->device_type == BTN_TOOL_PEN) {
1410 __set_bit(BTN_7, input_dev->keybit);
1411 __set_bit(BTN_8, input_dev->keybit);
1412 }
1413 /* fall through */
1414
1415 case INTUOS5S:
1416 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1417
1418 if (features->device_type == BTN_TOOL_PEN) {
1419 for (i = 0; i < 7; i++)
1420 __set_bit(BTN_0 + i, input_dev->keybit);
1421
1422 input_set_abs_params(input_dev, ABS_DISTANCE, 0,
1423 features->distance_max,
1424 0, 0);
1425
1426 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1427
1428 wacom_setup_intuos(wacom_wac);
1429 } else if (features->device_type == BTN_TOOL_FINGER) {
1430 __clear_bit(ABS_MISC, input_dev->absbit);
1431
1432 __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1433 __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
1434 __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
1435 __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit);
1436
1437 input_mt_init_slots(input_dev, 16);
1438
1439 input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
1440 0, 255, 0, 0);
1441
1442 input_set_abs_params(input_dev, ABS_MT_POSITION_X,
1443 0, features->x_max,
1444 features->x_fuzz, 0);
1445 input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
1446 0, features->y_max,
1447 features->y_fuzz, 0);
1448 }
1449 break;
1450
1396 case INTUOS4: 1451 case INTUOS4:
1397 case INTUOS4L: 1452 case INTUOS4L:
1398 __set_bit(BTN_7, input_dev->keybit); 1453 __set_bit(BTN_7, input_dev->keybit);
1399 __set_bit(BTN_8, input_dev->keybit); 1454 __set_bit(BTN_8, input_dev->keybit);
1400 /* fall through */ 1455 /* fall through */
1401 1456
1402 case INTUOS5S:
1403 case INTUOS4S: 1457 case INTUOS4S:
1404 for (i = 0; i < 7; i++) 1458 for (i = 0; i < 7; i++)
1405 __set_bit(BTN_0 + i, input_dev->keybit); 1459 __set_bit(BTN_0 + i, input_dev->keybit);