Commit 4a88081e authored by Ping Cheng's avatar Ping Cheng Committed by Dmitry Torokhov

Input: wacom - parse the Bamboo device family

The Bamboo devices have multiple interfaces which need to be setup
separately. Use the HID parsing mechanism to achieve that.
Signed-off-by: default avatarPing Cheng <pinglinux@gmail.com>
Signed-off-by: default avatarHenrik Rydberg <rydberg@euromail.se>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent fed87e65
...@@ -195,17 +195,30 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi ...@@ -195,17 +195,30 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
features->pktlen = WACOM_PKGLEN_TPC2FG; features->pktlen = WACOM_PKGLEN_TPC2FG;
features->device_type = BTN_TOOL_TRIPLETAP; features->device_type = BTN_TOOL_TRIPLETAP;
} }
features->x_max = if (features->type == BAMBOO_PT) {
get_unaligned_le16(&report[i + 3]); /* need to reset back */
features->x_phy = features->pktlen = WACOM_PKGLEN_BBTOUCH;
get_unaligned_le16(&report[i + 6]); features->device_type = BTN_TOOL_TRIPLETAP;
features->unit = report[i + 9]; features->x_phy =
features->unitExpo = report[i + 11]; get_unaligned_le16(&report[i + 5]);
i += 12; features->x_max =
get_unaligned_le16(&report[i + 8]);
i += 15;
} else {
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;
}
} else if (pen) { } else if (pen) {
/* penabled only accepts exact bytes of data */ /* penabled only accepts exact bytes of data */
if (features->type == TABLETPC2FG) if (features->type == TABLETPC2FG)
features->pktlen = WACOM_PKGLEN_GRAPHIRE; features->pktlen = WACOM_PKGLEN_GRAPHIRE;
if (features->type == BAMBOO_PT)
features->pktlen = WACOM_PKGLEN_BBFUN;
features->device_type = BTN_TOOL_PEN; features->device_type = BTN_TOOL_PEN;
features->x_max = features->x_max =
get_unaligned_le16(&report[i + 3]); get_unaligned_le16(&report[i + 3]);
...@@ -234,6 +247,15 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi ...@@ -234,6 +247,15 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
features->y_phy = features->y_phy =
get_unaligned_le16(&report[i + 6]); get_unaligned_le16(&report[i + 6]);
i += 7; i += 7;
} else if (features->type == BAMBOO_PT) {
/* need to reset back */
features->pktlen = WACOM_PKGLEN_BBTOUCH;
features->device_type = BTN_TOOL_TRIPLETAP;
features->y_phy =
get_unaligned_le16(&report[i + 3]);
features->y_max =
get_unaligned_le16(&report[i + 6]);
i += 12;
} else { } else {
features->y_max = features->y_max =
features->x_max; features->x_max;
...@@ -245,6 +267,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi ...@@ -245,6 +267,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
/* penabled only accepts exact bytes of data */ /* penabled only accepts exact bytes of data */
if (features->type == TABLETPC2FG) if (features->type == TABLETPC2FG)
features->pktlen = WACOM_PKGLEN_GRAPHIRE; features->pktlen = WACOM_PKGLEN_GRAPHIRE;
if (features->type == BAMBOO_PT)
features->pktlen = WACOM_PKGLEN_BBFUN;
features->device_type = BTN_TOOL_PEN; features->device_type = BTN_TOOL_PEN;
features->y_max = features->y_max =
get_unaligned_le16(&report[i + 3]); get_unaligned_le16(&report[i + 3]);
...@@ -341,7 +365,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf, ...@@ -341,7 +365,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
features->distance_fuzz = 0; features->distance_fuzz = 0;
/* only Tablet PCs need to retrieve the info */ /* only Tablet PCs need to retrieve the info */
if ((features->type != TABLETPC) && (features->type != TABLETPC2FG)) if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) &&
(features->type != BAMBOO_PT))
goto out; goto out;
if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
...@@ -499,7 +524,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -499,7 +524,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
if (features->type == TABLETPC || features->type == TABLETPC2FG) { if (features->type == TABLETPC || features->type == TABLETPC2FG ||
features->type == BAMBOO_PT) {
/* Append the device type to the name */ /* Append the device type to the name */
strlcat(wacom_wac->name, strlcat(wacom_wac->name,
features->device_type == BTN_TOOL_PEN ? features->device_type == BTN_TOOL_PEN ?
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define WACOM_PKGLEN_INTUOS 10 #define WACOM_PKGLEN_INTUOS 10
#define WACOM_PKGLEN_TPC1FG 5 #define WACOM_PKGLEN_TPC1FG 5
#define WACOM_PKGLEN_TPC2FG 14 #define WACOM_PKGLEN_TPC2FG 14
#define WACOM_PKGLEN_BBTOUCH 20
/* device IDs */ /* device IDs */
#define STYLUS_DEVICE_ID 0x02 #define STYLUS_DEVICE_ID 0x02
...@@ -44,6 +45,7 @@ enum { ...@@ -44,6 +45,7 @@ enum {
PTU, PTU,
PL, PL,
DTU, DTU,
BAMBOO_PT,
INTUOS, INTUOS,
INTUOS3S, INTUOS3S,
INTUOS3, INTUOS3,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment