diff options
author | Ping Cheng <pinglinux@gmail.com> | 2010-09-05 15:25:40 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-09-05 15:58:03 -0400 |
commit | 4a88081e739a41d6d70bace7e0a027f9054ab540 (patch) | |
tree | 8fd8ddd30cc3ad4c53debdb174b987060621fba5 /drivers/input/tablet | |
parent | fed87e655a2c20468d628b37424af58287803afe (diff) |
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: Ping Cheng <pinglinux@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 44 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.h | 2 |
2 files changed, 37 insertions, 9 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index e510e4fb54f7..98cba08bb96e 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -195,17 +195,30 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
195 | features->pktlen = WACOM_PKGLEN_TPC2FG; | 195 | features->pktlen = WACOM_PKGLEN_TPC2FG; |
196 | features->device_type = BTN_TOOL_TRIPLETAP; | 196 | features->device_type = BTN_TOOL_TRIPLETAP; |
197 | } | 197 | } |
198 | features->x_max = | 198 | if (features->type == BAMBOO_PT) { |
199 | get_unaligned_le16(&report[i + 3]); | 199 | /* need to reset back */ |
200 | features->x_phy = | 200 | features->pktlen = WACOM_PKGLEN_BBTOUCH; |
201 | get_unaligned_le16(&report[i + 6]); | 201 | features->device_type = BTN_TOOL_TRIPLETAP; |
202 | features->unit = report[i + 9]; | 202 | features->x_phy = |
203 | features->unitExpo = report[i + 11]; | 203 | get_unaligned_le16(&report[i + 5]); |
204 | i += 12; | 204 | features->x_max = |
205 | get_unaligned_le16(&report[i + 8]); | ||
206 | i += 15; | ||
207 | } else { | ||
208 | features->x_max = | ||
209 | get_unaligned_le16(&report[i + 3]); | ||
210 | features->x_phy = | ||
211 | get_unaligned_le16(&report[i + 6]); | ||
212 | features->unit = report[i + 9]; | ||
213 | features->unitExpo = report[i + 11]; | ||
214 | i += 12; | ||
215 | } | ||
205 | } else if (pen) { | 216 | } else if (pen) { |
206 | /* penabled only accepts exact bytes of data */ | 217 | /* penabled only accepts exact bytes of data */ |
207 | if (features->type == TABLETPC2FG) | 218 | if (features->type == TABLETPC2FG) |
208 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; | 219 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; |
220 | if (features->type == BAMBOO_PT) | ||
221 | features->pktlen = WACOM_PKGLEN_BBFUN; | ||
209 | features->device_type = BTN_TOOL_PEN; | 222 | features->device_type = BTN_TOOL_PEN; |
210 | features->x_max = | 223 | features->x_max = |
211 | get_unaligned_le16(&report[i + 3]); | 224 | get_unaligned_le16(&report[i + 3]); |
@@ -234,6 +247,15 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
234 | features->y_phy = | 247 | features->y_phy = |
235 | get_unaligned_le16(&report[i + 6]); | 248 | get_unaligned_le16(&report[i + 6]); |
236 | i += 7; | 249 | i += 7; |
250 | } else if (features->type == BAMBOO_PT) { | ||
251 | /* need to reset back */ | ||
252 | features->pktlen = WACOM_PKGLEN_BBTOUCH; | ||
253 | features->device_type = BTN_TOOL_TRIPLETAP; | ||
254 | features->y_phy = | ||
255 | get_unaligned_le16(&report[i + 3]); | ||
256 | features->y_max = | ||
257 | get_unaligned_le16(&report[i + 6]); | ||
258 | i += 12; | ||
237 | } else { | 259 | } else { |
238 | features->y_max = | 260 | features->y_max = |
239 | features->x_max; | 261 | features->x_max; |
@@ -245,6 +267,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
245 | /* penabled only accepts exact bytes of data */ | 267 | /* penabled only accepts exact bytes of data */ |
246 | if (features->type == TABLETPC2FG) | 268 | if (features->type == TABLETPC2FG) |
247 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; | 269 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; |
270 | if (features->type == BAMBOO_PT) | ||
271 | features->pktlen = WACOM_PKGLEN_BBFUN; | ||
248 | features->device_type = BTN_TOOL_PEN; | 272 | features->device_type = BTN_TOOL_PEN; |
249 | features->y_max = | 273 | features->y_max = |
250 | get_unaligned_le16(&report[i + 3]); | 274 | get_unaligned_le16(&report[i + 3]); |
@@ -341,7 +365,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf, | |||
341 | features->distance_fuzz = 0; | 365 | features->distance_fuzz = 0; |
342 | 366 | ||
343 | /* only Tablet PCs need to retrieve the info */ | 367 | /* only Tablet PCs need to retrieve the info */ |
344 | if ((features->type != TABLETPC) && (features->type != TABLETPC2FG)) | 368 | if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) && |
369 | (features->type != BAMBOO_PT)) | ||
345 | goto out; | 370 | goto out; |
346 | 371 | ||
347 | if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { | 372 | 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 | 524 | ||
500 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); | 525 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); |
501 | 526 | ||
502 | if (features->type == TABLETPC || features->type == TABLETPC2FG) { | 527 | if (features->type == TABLETPC || features->type == TABLETPC2FG || |
528 | features->type == BAMBOO_PT) { | ||
503 | /* Append the device type to the name */ | 529 | /* Append the device type to the name */ |
504 | strlcat(wacom_wac->name, | 530 | strlcat(wacom_wac->name, |
505 | features->device_type == BTN_TOOL_PEN ? | 531 | features->device_type == BTN_TOOL_PEN ? |
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index d769e9aa6f10..fb30895d63e3 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define WACOM_PKGLEN_INTUOS 10 | 21 | #define WACOM_PKGLEN_INTUOS 10 |
22 | #define WACOM_PKGLEN_TPC1FG 5 | 22 | #define WACOM_PKGLEN_TPC1FG 5 |
23 | #define WACOM_PKGLEN_TPC2FG 14 | 23 | #define WACOM_PKGLEN_TPC2FG 14 |
24 | #define WACOM_PKGLEN_BBTOUCH 20 | ||
24 | 25 | ||
25 | /* device IDs */ | 26 | /* device IDs */ |
26 | #define STYLUS_DEVICE_ID 0x02 | 27 | #define STYLUS_DEVICE_ID 0x02 |
@@ -44,6 +45,7 @@ enum { | |||
44 | PTU, | 45 | PTU, |
45 | PL, | 46 | PL, |
46 | DTU, | 47 | DTU, |
48 | BAMBOO_PT, | ||
47 | INTUOS, | 49 | INTUOS, |
48 | INTUOS3S, | 50 | INTUOS3S, |
49 | INTUOS3, | 51 | INTUOS3, |