diff options
| author | Nikolai Kondrashov <spbnick@gmail.com> | 2012-08-26 13:55:08 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2012-08-27 11:09:21 -0400 |
| commit | eb4e426a480ce99004134ee22e6a3b7ab88f979c (patch) | |
| tree | fe8dfede0e32eda7a5e79740af55761a1ba99b7e /drivers | |
| parent | d37e44969e60dc652fdbaf4397d5436e07c967af (diff) | |
HID: uclogic: Add support for UC-Logic TWHA60
Add support for UC-Logic Tablet TWHA60.
It is known to be sold as Genius EasyPen M610 and Monoprice MP1060-HA60.
As this tablet has several variations with different number and different
assignments of frame buttons, they are simply mapped to F1-F24 range and are
left for users to remap in userspace.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
| -rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
| -rw-r--r-- | drivers/hid/hid-uclogic.c | 98 |
3 files changed, 100 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8bf8a64e5115..23a583145a72 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -1660,6 +1660,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
| 1660 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U) }, | 1660 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U) }, |
| 1661 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) }, | 1661 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) }, |
| 1662 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) }, | 1662 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) }, |
| 1663 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60) }, | ||
| 1663 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) }, | 1664 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) }, |
| 1664 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SUPER_JOY_BOX_3) }, | 1665 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SUPER_JOY_BOX_3) }, |
| 1665 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) }, | 1666 | { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 1dcb76ff51e3..5d8ffc494d93 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -758,6 +758,7 @@ | |||
| 758 | #define USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U 0x0005 | 758 | #define USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U 0x0005 |
| 759 | #define USB_DEVICE_ID_UCLOGIC_TABLET_WP1062 0x0064 | 759 | #define USB_DEVICE_ID_UCLOGIC_TABLET_WP1062 0x0064 |
| 760 | #define USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850 0x0522 | 760 | #define USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850 0x0522 |
| 761 | #define USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60 0x0781 | ||
| 761 | 762 | ||
| 762 | #define USB_VENDOR_ID_UNITEC 0x227d | 763 | #define USB_VENDOR_ID_UNITEC 0x227d |
| 763 | #define USB_DEVICE_ID_UNITEC_USB_TOUCH_0709 0x0709 | 764 | #define USB_DEVICE_ID_UNITEC_USB_TOUCH_0709 0x0709 |
diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c index 3aba02be1f26..2e56a1fd2375 100644 --- a/drivers/hid/hid-uclogic.c +++ b/drivers/hid/hid-uclogic.c | |||
| @@ -466,6 +466,86 @@ static __u8 twhl850_rdesc_fixed2[] = { | |||
| 466 | 0xC0 /* End Collection */ | 466 | 0xC0 /* End Collection */ |
| 467 | }; | 467 | }; |
| 468 | 468 | ||
| 469 | /* | ||
| 470 | * See TWHA60 description, device and HID report descriptors at | ||
| 471 | * http://sf.net/apps/mediawiki/digimend/?title=UC-Logic_Tablet_TWHA60 | ||
| 472 | */ | ||
| 473 | |||
| 474 | /* Size of the original descriptors of TWHA60 tablet */ | ||
| 475 | #define TWHA60_RDESC_ORIG_SIZE0 254 | ||
| 476 | #define TWHA60_RDESC_ORIG_SIZE1 139 | ||
| 477 | |||
| 478 | /* Fixed TWHA60 report descriptor, interface 0 (stylus) */ | ||
| 479 | static __u8 twha60_rdesc_fixed0[] = { | ||
| 480 | 0x05, 0x0D, /* Usage Page (Digitizer), */ | ||
| 481 | 0x09, 0x02, /* Usage (Pen), */ | ||
| 482 | 0xA1, 0x01, /* Collection (Application), */ | ||
| 483 | 0x85, 0x09, /* Report ID (9), */ | ||
| 484 | 0x09, 0x20, /* Usage (Stylus), */ | ||
| 485 | 0xA0, /* Collection (Physical), */ | ||
| 486 | 0x75, 0x01, /* Report Size (1), */ | ||
| 487 | 0x09, 0x42, /* Usage (Tip Switch), */ | ||
| 488 | 0x09, 0x44, /* Usage (Barrel Switch), */ | ||
| 489 | 0x09, 0x46, /* Usage (Tablet Pick), */ | ||
| 490 | 0x14, /* Logical Minimum (0), */ | ||
| 491 | 0x25, 0x01, /* Logical Maximum (1), */ | ||
| 492 | 0x95, 0x03, /* Report Count (3), */ | ||
| 493 | 0x81, 0x02, /* Input (Variable), */ | ||
| 494 | 0x95, 0x04, /* Report Count (4), */ | ||
| 495 | 0x81, 0x01, /* Input (Constant), */ | ||
| 496 | 0x09, 0x32, /* Usage (In Range), */ | ||
| 497 | 0x95, 0x01, /* Report Count (1), */ | ||
| 498 | 0x81, 0x02, /* Input (Variable), */ | ||
| 499 | 0x75, 0x10, /* Report Size (16), */ | ||
| 500 | 0x95, 0x01, /* Report Count (1), */ | ||
| 501 | 0x14, /* Logical Minimum (0), */ | ||
| 502 | 0xA4, /* Push, */ | ||
| 503 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
| 504 | 0x55, 0xFD, /* Unit Exponent (-3), */ | ||
| 505 | 0x65, 0x13, /* Unit (Inch), */ | ||
| 506 | 0x34, /* Physical Minimum (0), */ | ||
| 507 | 0x09, 0x30, /* Usage (X), */ | ||
| 508 | 0x46, 0x10, 0x27, /* Physical Maximum (10000), */ | ||
| 509 | 0x27, 0x3F, 0x9C, | ||
| 510 | 0x00, 0x00, /* Logical Maximum (39999), */ | ||
| 511 | 0x81, 0x02, /* Input (Variable), */ | ||
| 512 | 0x09, 0x31, /* Usage (Y), */ | ||
| 513 | 0x46, 0x6A, 0x18, /* Physical Maximum (6250), */ | ||
| 514 | 0x26, 0xA7, 0x61, /* Logical Maximum (24999), */ | ||
| 515 | 0x81, 0x02, /* Input (Variable), */ | ||
| 516 | 0xB4, /* Pop, */ | ||
| 517 | 0x09, 0x30, /* Usage (Tip Pressure), */ | ||
| 518 | 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */ | ||
| 519 | 0x81, 0x02, /* Input (Variable), */ | ||
| 520 | 0xC0, /* End Collection, */ | ||
| 521 | 0xC0 /* End Collection */ | ||
| 522 | }; | ||
| 523 | |||
| 524 | /* Fixed TWHA60 report descriptor, interface 1 (frame buttons) */ | ||
| 525 | static __u8 twha60_rdesc_fixed1[] = { | ||
| 526 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
| 527 | 0x09, 0x06, /* Usage (Keyboard), */ | ||
| 528 | 0xA1, 0x01, /* Collection (Application), */ | ||
| 529 | 0x85, 0x05, /* Report ID (5), */ | ||
| 530 | 0x05, 0x07, /* Usage Page (Keyboard), */ | ||
| 531 | 0x14, /* Logical Minimum (0), */ | ||
| 532 | 0x25, 0x01, /* Logical Maximum (1), */ | ||
| 533 | 0x75, 0x01, /* Report Size (1), */ | ||
| 534 | 0x95, 0x08, /* Report Count (8), */ | ||
| 535 | 0x81, 0x01, /* Input (Constant), */ | ||
| 536 | 0x95, 0x0C, /* Report Count (12), */ | ||
| 537 | 0x19, 0x3A, /* Usage Minimum (KB F1), */ | ||
| 538 | 0x29, 0x45, /* Usage Maximum (KB F12), */ | ||
| 539 | 0x81, 0x02, /* Input (Variable), */ | ||
| 540 | 0x95, 0x0C, /* Report Count (12), */ | ||
| 541 | 0x19, 0x68, /* Usage Minimum (KB F13), */ | ||
| 542 | 0x29, 0x73, /* Usage Maximum (KB F24), */ | ||
| 543 | 0x81, 0x02, /* Input (Variable), */ | ||
| 544 | 0x95, 0x08, /* Report Count (8), */ | ||
| 545 | 0x81, 0x01, /* Input (Constant), */ | ||
| 546 | 0xC0 /* End Collection */ | ||
| 547 | }; | ||
| 548 | |||
| 469 | static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, | 549 | static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
| 470 | unsigned int *rsize) | 550 | unsigned int *rsize) |
| 471 | { | 551 | { |
| @@ -525,6 +605,22 @@ static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
| 525 | break; | 605 | break; |
| 526 | } | 606 | } |
| 527 | break; | 607 | break; |
| 608 | case USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60: | ||
| 609 | switch (iface_num) { | ||
| 610 | case 0: | ||
| 611 | if (*rsize == TWHA60_RDESC_ORIG_SIZE0) { | ||
| 612 | rdesc = twha60_rdesc_fixed0; | ||
| 613 | *rsize = sizeof(twha60_rdesc_fixed0); | ||
| 614 | } | ||
| 615 | break; | ||
| 616 | case 1: | ||
| 617 | if (*rsize == TWHA60_RDESC_ORIG_SIZE1) { | ||
| 618 | rdesc = twha60_rdesc_fixed1; | ||
| 619 | *rsize = sizeof(twha60_rdesc_fixed1); | ||
| 620 | } | ||
| 621 | break; | ||
| 622 | } | ||
| 623 | break; | ||
| 528 | } | 624 | } |
| 529 | 625 | ||
| 530 | return rdesc; | 626 | return rdesc; |
| @@ -543,6 +639,8 @@ static const struct hid_device_id uclogic_devices[] = { | |||
| 543 | USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) }, | 639 | USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) }, |
| 544 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | 640 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, |
| 545 | USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) }, | 641 | USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) }, |
| 642 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | ||
| 643 | USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60) }, | ||
| 546 | { } | 644 | { } |
| 547 | }; | 645 | }; |
| 548 | MODULE_DEVICE_TABLE(hid, uclogic_devices); | 646 | MODULE_DEVICE_TABLE(hid, uclogic_devices); |
