aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-waltop.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2010-08-30 06:06:36 -0400
committerJiri Kosina <jkosina@suse.cz>2010-09-01 06:36:35 -0400
commit8f1acc32bbdb1784bcb0be98fb02f4b20e6f328f (patch)
tree5d7cebfce0faa22c80dadf9232b86eb5683f7953 /drivers/hid/hid-waltop.c
parent4b5b4575ce08a2597a21337b4f5404fa0a289403 (diff)
HID: waltop: add Media Tablet 14.1 inch support
Add support for Waltop Media Tablet 14.1 inch by fixing report descriptor. This tablet is also sold as Genius G-Pen M712 (older version) and M712X (newer version). Both are supported. Trust Wide Screen Design Tablet (TB-7300, item no 15358) seems to be the older version of this tablet (similar to Genius G-Pen M712), and could be supported as well. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-waltop.c')
-rw-r--r--drivers/hid/hid-waltop.c297
1 files changed, 297 insertions, 0 deletions
diff --git a/drivers/hid/hid-waltop.c b/drivers/hid/hid-waltop.c
index b9d49e4a392d..7d4b318c029f 100644
--- a/drivers/hid/hid-waltop.c
+++ b/drivers/hid/hid-waltop.c
@@ -510,6 +510,295 @@ static __u8 media_tablet_10_6_inch_rdesc_fixed[] = {
510 0xC0 /* End Collection */ 510 0xC0 /* End Collection */
511}; 511};
512 512
513/*
514 * Original Media Tablet 14.1 inch report descriptor.
515 *
516 * There are at least two versions of this model in the wild. They are
517 * represented by Genius G-Pen M712 (older version) and Genius G-Pen M712X
518 * (newer version). The hardware difference between these versions is the same
519 * as between older and newer versions of Media Tablet 10.6 inch. The report
520 * descriptors are identical for both versions.
521 *
522 * The function, behavior and report descriptor of this tablet is similar to
523 * that of Media Tablet 10.6 inch. However, there is one more field (with
524 * Consumer AC Pan usage) in the mouse description. Then the tablet X and Y
525 * logical extents both get scaled to 0..16383 range (a hardware limit?),
526 * which kind of defeats the advertised 4000 LPI resolution, considering the
527 * physical extents of 12x7.25 inches. Plus, reports 5, 10 and 255 are used
528 * sometimes (while moving the pen) with unknown purpose. Also, the key codes
529 * generated for zoom in/out are different.
530 *
531 * Usage Page (Desktop),
532 * Usage (Mouse),
533 * Collection (Application),
534 * Report ID (1),
535 * Usage (Pointer),
536 * Collection (Physical),
537 * Usage Page (Button),
538 * Usage Minimum (01h),
539 * Usage Maximum (05h),
540 * Logical Minimum (0),
541 * Logical Maximum (1),
542 * Report Size (1),
543 * Report Count (5),
544 * Input (Variable),
545 * Report Size (3),
546 * Report Count (1),
547 * Input (Constant, Variable),
548 * Usage Page (Desktop),
549 * Usage (X),
550 * Usage (Y),
551 * Usage (Wheel),
552 * Logical Minimum (-127),
553 * Logical Maximum (127),
554 * Report Size (8),
555 * Report Count (3),
556 * Input (Variable, Relative),
557 * Usage Page (Consumer),
558 * Logical Minimum (-127),
559 * Logical Maximum (127),
560 * Report Size (8),
561 * Report Count (1),
562 * Usage (AC Pan),
563 * Input (Variable, Relative),
564 * End Collection,
565 * End Collection,
566 * Usage Page (Digitizer),
567 * Usage (Pen),
568 * Collection (Application),
569 * Report ID (2),
570 * Usage (Stylus),
571 * Collection (Physical),
572 * Usage (00h),
573 * Logical Minimum (0),
574 * Logical Maximum (255),
575 * Report Size (8),
576 * Report Count (7),
577 * Input (Variable),
578 * Usage (Azimuth),
579 * Usage (Altitude),
580 * Logical Minimum (0),
581 * Logical Maximum (255),
582 * Report Size (8),
583 * Report Count (2),
584 * Feature (Variable),
585 * End Collection,
586 * Report ID (5),
587 * Usage Page (Digitizer),
588 * Usage (Stylus),
589 * Collection (Physical),
590 * Usage (00h),
591 * Logical Minimum (0),
592 * Logical Maximum (255),
593 * Report Size (8),
594 * Report Count (7),
595 * Input (Variable),
596 * End Collection,
597 * Report ID (10),
598 * Usage Page (Digitizer),
599 * Usage (Stylus),
600 * Collection (Physical),
601 * Usage (00h),
602 * Logical Minimum (0),
603 * Logical Maximum (255),
604 * Report Size (8),
605 * Report Count (7),
606 * Input (Variable),
607 * End Collection,
608 * Report ID (16),
609 * Usage (Stylus),
610 * Collection (Physical),
611 * Usage (Tip Switch),
612 * Usage (Barrel Switch),
613 * Usage (Invert),
614 * Usage (Eraser),
615 * Usage (In Range),
616 * Logical Minimum (0),
617 * Logical Maximum (1),
618 * Report Size (1),
619 * Report Count (5),
620 * Input (Variable),
621 * Report Count (3),
622 * Input (Constant, Variable),
623 * Usage Page (Desktop),
624 * Usage (X),
625 * Report Size (16),
626 * Report Count (1),
627 * Push,
628 * Unit Exponent (13),
629 * Unit (Inch^3),
630 * Logical Minimum (0),
631 * Logical Maximum (16383),
632 * Physical Minimum (0),
633 * Physical Maximum (16383),
634 * Input (Variable),
635 * Usage (Y),
636 * Input (Variable),
637 * Usage Page (Digitizer),
638 * Usage (Tip Pressure),
639 * Logical Minimum (0),
640 * Logical Maximum (1023),
641 * Physical Minimum (0),
642 * Physical Maximum (1023),
643 * Input (Variable),
644 * End Collection,
645 * End Collection,
646 * Usage Page (Desktop),
647 * Usage (Keyboard),
648 * Collection (Application),
649 * Report ID (13),
650 * Usage Page (Keyboard),
651 * Usage Minimum (KB Leftcontrol),
652 * Usage Maximum (KB Right GUI),
653 * Logical Minimum (0),
654 * Logical Maximum (1),
655 * Report Size (1),
656 * Report Count (8),
657 * Input (Variable),
658 * Report Size (8),
659 * Report Count (1),
660 * Input (Constant),
661 * Usage Page (Keyboard),
662 * Usage Minimum (None),
663 * Usage Maximum (KB Application),
664 * Logical Minimum (0),
665 * Logical Maximum (101),
666 * Report Size (8),
667 * Report Count (5),
668 * Input,
669 * End Collection,
670 * Usage Page (Consumer),
671 * Usage (Consumer Control),
672 * Collection (Application),
673 * Report ID (12),
674 * Usage (Volume Inc),
675 * Usage (Volume Dec),
676 * Usage (Mute),
677 * Logical Minimum (0),
678 * Logical Maximum (1),
679 * Report Size (1),
680 * Report Count (3),
681 * Input (Variable, Relative),
682 * Report Size (5),
683 * Report Count (1),
684 * Input (Constant, Variable, Relative),
685 * End Collection
686 */
687
688/* Size of the original report descriptor of Media Tablet 14.1 inch */
689#define MEDIA_TABLET_14_1_INCH_RDESC_ORIG_SIZE 309
690
691/*
692 * Fixed Media Tablet 14.1 inch descriptor.
693 * It is fixed similarly to the Media Tablet 10.6 inch descriptor.
694 */
695static __u8 media_tablet_14_1_inch_rdesc_fixed[] = {
696 0x05, 0x0D, /* Usage Page (Digitizer), */
697 0x09, 0x02, /* Usage (Pen), */
698 0xA1, 0x01, /* Collection (Application), */
699 0x85, 0x10, /* Report ID (16), */
700 0x09, 0x20, /* Usage (Stylus), */
701 0xA0, /* Collection (Physical), */
702 0x09, 0x42, /* Usage (Tip Switch), */
703 0x09, 0x44, /* Usage (Barrel Switch), */
704 0x09, 0x46, /* Usage (Tablet Pick), */
705 0x15, 0x01, /* Logical Minimum (1), */
706 0x25, 0x03, /* Logical Maximum (3), */
707 0x75, 0x04, /* Report Size (4), */
708 0x95, 0x01, /* Report Count (1), */
709 0x80, /* Input, */
710 0x75, 0x01, /* Report Size (1), */
711 0x09, 0x32, /* Usage (In Range), */
712 0x14, /* Logical Minimum (0), */
713 0x25, 0x01, /* Logical Maximum (1), */
714 0x95, 0x01, /* Report Count (1), */
715 0x81, 0x02, /* Input (Variable), */
716 0x95, 0x03, /* Report Count (3), */
717 0x81, 0x03, /* Input (Constant, Variable), */
718 0x75, 0x10, /* Report Size (16), */
719 0x95, 0x01, /* Report Count (1), */
720 0x14, /* Logical Minimum (0), */
721 0xA4, /* Push, */
722 0x05, 0x01, /* Usage Page (Desktop), */
723 0x65, 0x13, /* Unit (Inch), */
724 0x55, 0xFD, /* Unit Exponent (-3), */
725 0x34, /* Physical Minimum (0), */
726 0x09, 0x30, /* Usage (X), */
727 0x46, 0xE0, 0x2E, /* Physical Maximum (12000), */
728 0x26, 0xFF, 0x3F, /* Logical Maximum (16383), */
729 0x81, 0x02, /* Input (Variable), */
730 0x09, 0x31, /* Usage (Y), */
731 0x46, 0x52, 0x1C, /* Physical Maximum (7250), */
732 0x26, 0xFF, 0x3F, /* Logical Maximum (16383), */
733 0x81, 0x02, /* Input (Variable), */
734 0xB4, /* Pop, */
735 0x09, 0x30, /* Usage (Tip Pressure), */
736 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
737 0x81, 0x02, /* Input (Variable), */
738 0xC0, /* End Collection, */
739 0xC0, /* End Collection, */
740 0x05, 0x01, /* Usage Page (Desktop), */
741 0x09, 0x02, /* Usage (Mouse), */
742 0xA1, 0x01, /* Collection (Application), */
743 0x85, 0x01, /* Report ID (1), */
744 0x09, 0x01, /* Usage (Pointer), */
745 0xA0, /* Collection (Physical), */
746 0x75, 0x08, /* Report Size (8), */
747 0x95, 0x03, /* Report Count (3), */
748 0x81, 0x03, /* Input (Constant, Variable), */
749 0x95, 0x02, /* Report Count (2), */
750 0x15, 0xFF, /* Logical Minimum (-1), */
751 0x25, 0x01, /* Logical Maximum (1), */
752 0x09, 0x38, /* Usage (Wheel), */
753 0x0B, 0x38, 0x02, /* Usage (Consumer AC Pan), */
754 0x0C, 0x00,
755 0x81, 0x06, /* Input (Variable, Relative), */
756 0xC0, /* End Collection, */
757 0xC0, /* End Collection, */
758 0x05, 0x0C, /* Usage Page (Consumer), */
759 0x09, 0x01, /* Usage (Consumer Control), */
760 0xA1, 0x01, /* Collection (Application), */
761 0x85, 0x0D, /* Report ID (13), */
762 0x95, 0x01, /* Report Count (1), */
763 0x75, 0x10, /* Report Size (16), */
764 0x81, 0x03, /* Input (Constant, Variable), */
765 0x0A, 0x2F, 0x02, /* Usage (AC Zoom), */
766 0x0A, 0x2E, 0x02, /* Usage (AC Zoom Out), */
767 0x0A, 0x2D, 0x02, /* Usage (AC Zoom In), */
768 0x09, 0xB6, /* Usage (Scan Previous Track), */
769 0x09, 0xB5, /* Usage (Scan Next Track), */
770 0x08, /* Usage (00h), */
771 0x08, /* Usage (00h), */
772 0x08, /* Usage (00h), */
773 0x08, /* Usage (00h), */
774 0x08, /* Usage (00h), */
775 0x0A, 0x2E, 0x02, /* Usage (AC Zoom Out), */
776 0x0A, 0x2D, 0x02, /* Usage (AC Zoom In), */
777 0x15, 0x0C, /* Logical Minimum (12), */
778 0x25, 0x17, /* Logical Maximum (23), */
779 0x75, 0x05, /* Report Size (5), */
780 0x80, /* Input, */
781 0x75, 0x03, /* Report Size (3), */
782 0x81, 0x03, /* Input (Constant, Variable), */
783 0x75, 0x20, /* Report Size (32), */
784 0x81, 0x03, /* Input (Constant, Variable), */
785 0xC0, /* End Collection, */
786 0x09, 0x01, /* Usage (Consumer Control), */
787 0xA1, 0x01, /* Collection (Application), */
788 0x85, 0x0C, /* Report ID (12), */
789 0x75, 0x01, /* Report Size (1), */
790 0x09, 0xE9, /* Usage (Volume Inc), */
791 0x09, 0xEA, /* Usage (Volume Dec), */
792 0x09, 0xE2, /* Usage (Mute), */
793 0x14, /* Logical Minimum (0), */
794 0x25, 0x01, /* Logical Maximum (1), */
795 0x95, 0x03, /* Report Count (3), */
796 0x81, 0x06, /* Input (Variable, Relative), */
797 0x75, 0x05, /* Report Size (5), */
798 0x81, 0x03, /* Input (Constant, Variable), */
799 0xC0 /* End Collection */
800};
801
513static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, 802static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
514 unsigned int *rsize) 803 unsigned int *rsize)
515{ 804{
@@ -526,6 +815,12 @@ static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
526 *rsize = sizeof(media_tablet_10_6_inch_rdesc_fixed); 815 *rsize = sizeof(media_tablet_10_6_inch_rdesc_fixed);
527 } 816 }
528 break; 817 break;
818 case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH:
819 if (*rsize == MEDIA_TABLET_14_1_INCH_RDESC_ORIG_SIZE) {
820 rdesc = media_tablet_14_1_inch_rdesc_fixed;
821 *rsize = sizeof(media_tablet_14_1_inch_rdesc_fixed);
822 }
823 break;
529 } 824 }
530 return rdesc; 825 return rdesc;
531} 826}
@@ -535,6 +830,8 @@ static const struct hid_device_id waltop_devices[] = {
535 USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, 830 USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
536 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, 831 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
537 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) }, 832 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
833 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
834 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },
538 { } 835 { }
539}; 836};
540MODULE_DEVICE_TABLE(hid, waltop_devices); 837MODULE_DEVICE_TABLE(hid, waltop_devices);