aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/tablet/wacom_sys.c')
-rw-r--r--drivers/input/tablet/wacom_sys.c58
1 files changed, 43 insertions, 15 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 858ad446de9..f92d34f45a1 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -386,23 +386,40 @@ static int wacom_parse_hid(struct usb_interface *intf,
386 if (usage == WCM_DESKTOP) { 386 if (usage == WCM_DESKTOP) {
387 if (finger) { 387 if (finger) {
388 features->device_type = BTN_TOOL_FINGER; 388 features->device_type = BTN_TOOL_FINGER;
389 if (features->type == TABLETPC2FG) { 389
390 /* need to reset back */ 390 switch (features->type) {
391 case TABLETPC2FG:
391 features->pktlen = WACOM_PKGLEN_TPC2FG; 392 features->pktlen = WACOM_PKGLEN_TPC2FG;
392 } 393 break;
393 394
394 if (features->type == MTSCREEN || features->type == WACOM_24HDT) 395 case MTSCREEN:
396 case WACOM_24HDT:
395 features->pktlen = WACOM_PKGLEN_MTOUCH; 397 features->pktlen = WACOM_PKGLEN_MTOUCH;
398 break;
396 399
397 if (features->type == BAMBOO_PT) { 400 case MTTPC:
398 /* need to reset back */ 401 features->pktlen = WACOM_PKGLEN_MTTPC;
402 break;
403
404 case BAMBOO_PT:
399 features->pktlen = WACOM_PKGLEN_BBTOUCH; 405 features->pktlen = WACOM_PKGLEN_BBTOUCH;
406 break;
407
408 default:
409 features->pktlen = WACOM_PKGLEN_GRAPHIRE;
410 break;
411 }
412
413 switch (features->type) {
414 case BAMBOO_PT:
400 features->x_phy = 415 features->x_phy =
401 get_unaligned_le16(&report[i + 5]); 416 get_unaligned_le16(&report[i + 5]);
402 features->x_max = 417 features->x_max =
403 get_unaligned_le16(&report[i + 8]); 418 get_unaligned_le16(&report[i + 8]);
404 i += 15; 419 i += 15;
405 } else if (features->type == WACOM_24HDT) { 420 break;
421
422 case WACOM_24HDT:
406 features->x_max = 423 features->x_max =
407 get_unaligned_le16(&report[i + 3]); 424 get_unaligned_le16(&report[i + 3]);
408 features->x_phy = 425 features->x_phy =
@@ -410,7 +427,9 @@ static int wacom_parse_hid(struct usb_interface *intf,
410 features->unit = report[i - 1]; 427 features->unit = report[i - 1];
411 features->unitExpo = report[i - 3]; 428 features->unitExpo = report[i - 3];
412 i += 12; 429 i += 12;
413 } else { 430 break;
431
432 default:
414 features->x_max = 433 features->x_max =
415 get_unaligned_le16(&report[i + 3]); 434 get_unaligned_le16(&report[i + 3]);
416 features->x_phy = 435 features->x_phy =
@@ -418,10 +437,11 @@ static int wacom_parse_hid(struct usb_interface *intf,
418 features->unit = report[i + 9]; 437 features->unit = report[i + 9];
419 features->unitExpo = report[i + 11]; 438 features->unitExpo = report[i + 11];
420 i += 12; 439 i += 12;
440 break;
421 } 441 }
422 } else if (pen) { 442 } else if (pen) {
423 /* penabled only accepts exact bytes of data */ 443 /* penabled only accepts exact bytes of data */
424 if (features->type == TABLETPC2FG) 444 if (features->type >= TABLETPC)
425 features->pktlen = WACOM_PKGLEN_GRAPHIRE; 445 features->pktlen = WACOM_PKGLEN_GRAPHIRE;
426 features->device_type = BTN_TOOL_PEN; 446 features->device_type = BTN_TOOL_PEN;
427 features->x_max = 447 features->x_max =
@@ -434,32 +454,40 @@ static int wacom_parse_hid(struct usb_interface *intf,
434 case HID_USAGE_Y: 454 case HID_USAGE_Y:
435 if (usage == WCM_DESKTOP) { 455 if (usage == WCM_DESKTOP) {
436 if (finger) { 456 if (finger) {
437 int type = features->type; 457 switch (features->type) {
438 458 case TABLETPC2FG:
439 if (type == TABLETPC2FG || type == MTSCREEN) { 459 case MTSCREEN:
460 case MTTPC:
440 features->y_max = 461 features->y_max =
441 get_unaligned_le16(&report[i + 3]); 462 get_unaligned_le16(&report[i + 3]);
442 features->y_phy = 463 features->y_phy =
443 get_unaligned_le16(&report[i + 6]); 464 get_unaligned_le16(&report[i + 6]);
444 i += 7; 465 i += 7;
445 } else if (type == WACOM_24HDT) { 466 break;
467
468 case WACOM_24HDT:
446 features->y_max = 469 features->y_max =
447 get_unaligned_le16(&report[i + 3]); 470 get_unaligned_le16(&report[i + 3]);
448 features->y_phy = 471 features->y_phy =
449 get_unaligned_le16(&report[i - 2]); 472 get_unaligned_le16(&report[i - 2]);
450 i += 7; 473 i += 7;
451 } else if (type == BAMBOO_PT) { 474 break;
475
476 case BAMBOO_PT:
452 features->y_phy = 477 features->y_phy =
453 get_unaligned_le16(&report[i + 3]); 478 get_unaligned_le16(&report[i + 3]);
454 features->y_max = 479 features->y_max =
455 get_unaligned_le16(&report[i + 6]); 480 get_unaligned_le16(&report[i + 6]);
456 i += 12; 481 i += 12;
457 } else { 482 break;
483
484 default:
458 features->y_max = 485 features->y_max =
459 features->x_max; 486 features->x_max;
460 features->y_phy = 487 features->y_phy =
461 get_unaligned_le16(&report[i + 3]); 488 get_unaligned_le16(&report[i + 3]);
462 i += 4; 489 i += 4;
490 break;
463 } 491 }
464 } else if (pen) { 492 } else if (pen) {
465 features->y_max = 493 features->y_max =