Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346931
b: refs/heads/master
c: 3699dd7
h: refs/heads/master
i:
  346929: 6dc9389
  346927: 687b20e
v: v3
  • Loading branch information
Ping Cheng authored and Dmitry Torokhov committed Nov 8, 2012
1 parent 4cf5ef1 commit 6c6aff8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2be975c6d920de989ff5e4bc09ffe87e59d94662
refs/heads/master: 3699dd7e16a9f68586a44e1efeb9708359f9c2a6
53 changes: 38 additions & 15 deletions trunk/drivers/input/tablet/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,42 +386,58 @@ static int wacom_parse_hid(struct usb_interface *intf,
if (usage == WCM_DESKTOP) {
if (finger) {
features->device_type = BTN_TOOL_FINGER;
if (features->type == TABLETPC2FG) {
/* need to reset back */

switch (features->type) {
case TABLETPC2FG:
features->pktlen = WACOM_PKGLEN_TPC2FG;
}
break;

if (features->type == MTSCREEN || features->type == WACOM_24HDT)
case MTSCREEN:
case WACOM_24HDT:
features->pktlen = WACOM_PKGLEN_MTOUCH;
break;

if (features->type == BAMBOO_PT) {
/* need to reset back */
case BAMBOO_PT:
features->pktlen = WACOM_PKGLEN_BBTOUCH;
break;

default:
features->pktlen = WACOM_PKGLEN_GRAPHIRE;
break;
}

switch (features->type) {
case BAMBOO_PT:
features->x_phy =
get_unaligned_le16(&report[i + 5]);
features->x_max =
get_unaligned_le16(&report[i + 8]);
i += 15;
} else if (features->type == WACOM_24HDT) {
break;

case WACOM_24HDT:
features->x_max =
get_unaligned_le16(&report[i + 3]);
features->x_phy =
get_unaligned_le16(&report[i + 8]);
features->unit = report[i - 1];
features->unitExpo = report[i - 3];
i += 12;
} else {
break;

default:
features->x_max =
get_unaligned_le16(&report[i + 3]);
features->x_phy =
get_unaligned_le16(&report[i + 6]);
features->unit = report[i + 9];
features->unitExpo = report[i + 11];
i += 12;
break;
}
} else if (pen) {
/* penabled only accepts exact bytes of data */
if (features->type == TABLETPC2FG)
if (features->type >= TABLETPC)
features->pktlen = WACOM_PKGLEN_GRAPHIRE;
features->device_type = BTN_TOOL_PEN;
features->x_max =
Expand All @@ -434,32 +450,39 @@ static int wacom_parse_hid(struct usb_interface *intf,
case HID_USAGE_Y:
if (usage == WCM_DESKTOP) {
if (finger) {
int type = features->type;

if (type == TABLETPC2FG || type == MTSCREEN) {
switch (features->type) {
case TABLETPC2FG:
case MTSCREEN:
features->y_max =
get_unaligned_le16(&report[i + 3]);
features->y_phy =
get_unaligned_le16(&report[i + 6]);
i += 7;
} else if (type == WACOM_24HDT) {
break;

case WACOM_24HDT:
features->y_max =
get_unaligned_le16(&report[i + 3]);
features->y_phy =
get_unaligned_le16(&report[i - 2]);
i += 7;
} else if (type == BAMBOO_PT) {
break;

case BAMBOO_PT:
features->y_phy =
get_unaligned_le16(&report[i + 3]);
features->y_max =
get_unaligned_le16(&report[i + 6]);
i += 12;
} else {
break;

default:
features->y_max =
features->x_max;
features->y_phy =
get_unaligned_le16(&report[i + 3]);
i += 4;
break;
}
} else if (pen) {
features->y_max =
Expand Down

0 comments on commit 6c6aff8

Please sign in to comment.