aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-uclogic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-uclogic.c')
-rw-r--r--drivers/hid/hid-uclogic.c98
1 files changed, 98 insertions, 0 deletions
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) */
479static __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) */
525static __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
469static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, 549static __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};
548MODULE_DEVICE_TABLE(hid, uclogic_devices); 646MODULE_DEVICE_TABLE(hid, uclogic_devices);