diff options
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
-rw-r--r-- | drivers/hid/hid-waltop.c | 192 |
3 files changed, 194 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 23fa03176ace..162be0955df0 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1558,6 +1558,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1558 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH) }, | 1558 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH) }, |
1559 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, | 1559 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, |
1560 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) }, | 1560 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) }, |
1561 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_Q_PAD) }, | ||
1561 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) }, | 1562 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) }, |
1562 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) }, | 1563 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) }, |
1563 | { HID_USB_DEVICE(USB_VENDOR_ID_XAT, USB_DEVICE_ID_XAT_CSR) }, | 1564 | { HID_USB_DEVICE(USB_VENDOR_ID_XAT, USB_DEVICE_ID_XAT_CSR) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 5f63e361be13..1a002201516e 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -707,6 +707,7 @@ | |||
707 | #define USB_VENDOR_ID_WALTOP 0x172f | 707 | #define USB_VENDOR_ID_WALTOP 0x172f |
708 | #define USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH 0x0032 | 708 | #define USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH 0x0032 |
709 | #define USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH 0x0034 | 709 | #define USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH 0x0034 |
710 | #define USB_DEVICE_ID_WALTOP_Q_PAD 0x0037 | ||
710 | #define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH 0x0501 | 711 | #define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH 0x0501 |
711 | #define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH 0x0500 | 712 | #define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH 0x0500 |
712 | 713 | ||
diff --git a/drivers/hid/hid-waltop.c b/drivers/hid/hid-waltop.c index b3a4163f2e67..0ec169646ec7 100644 --- a/drivers/hid/hid-waltop.c +++ b/drivers/hid/hid-waltop.c | |||
@@ -424,6 +424,190 @@ static __u8 slim_tablet_12_1_inch_rdesc_fixed[] = { | |||
424 | }; | 424 | }; |
425 | 425 | ||
426 | /* | 426 | /* |
427 | * Original Q Pad report descriptor. | ||
428 | * | ||
429 | * The descriptor is similar to the Slim Tablet 5.8 inch descriptor with the | ||
430 | * addition of consumer AC Pan field to the report ID 1, which seems to be | ||
431 | * unused in the default mode. However, this tablet has resolution of 2048 LPI. | ||
432 | * | ||
433 | * Usage Page (Desktop), ; Generic desktop controls (01h) | ||
434 | * Usage (Mouse), ; Mouse (02h, application collection) | ||
435 | * Collection (Application), | ||
436 | * Report ID (1), | ||
437 | * Usage (Pointer), ; Pointer (01h, physical collection) | ||
438 | * Collection (Physical), | ||
439 | * Usage Page (Button), ; Button (09h) | ||
440 | * Usage Minimum (01h), | ||
441 | * Usage Maximum (05h), | ||
442 | * Logical Minimum (0), | ||
443 | * Logical Maximum (1), | ||
444 | * Report Size (1), | ||
445 | * Report Count (5), | ||
446 | * Input (Variable), | ||
447 | * Report Size (3), | ||
448 | * Report Count (1), | ||
449 | * Input (Constant, Variable), | ||
450 | * Usage Page (Desktop), ; Generic desktop controls (01h) | ||
451 | * Usage (X), ; X (30h, dynamic value) | ||
452 | * Usage (Y), ; Y (31h, dynamic value) | ||
453 | * Usage (Wheel), ; Wheel (38h, dynamic value) | ||
454 | * Logical Minimum (-127), | ||
455 | * Logical Maximum (127), | ||
456 | * Report Size (8), | ||
457 | * Report Count (3), | ||
458 | * Input (Variable, Relative), | ||
459 | * Usage Page (Consumer), ; Consumer (0Ch) | ||
460 | * Logical Minimum (-127), | ||
461 | * Logical Maximum (127), | ||
462 | * Report Size (8), | ||
463 | * Report Count (1), | ||
464 | * Usage (AC Pan), ; AC pan (0238h, linear control) | ||
465 | * Input (Variable, Relative), | ||
466 | * End Collection, | ||
467 | * End Collection, | ||
468 | * Usage Page (Digitizer), ; Digitizer (0Dh) | ||
469 | * Usage (Pen), ; Pen (02h, application collection) | ||
470 | * Collection (Application), | ||
471 | * Report ID (2), | ||
472 | * Usage (Stylus), ; Stylus (20h, logical collection) | ||
473 | * Collection (Physical), | ||
474 | * Usage (00h), | ||
475 | * Logical Minimum (0), | ||
476 | * Logical Maximum (255), | ||
477 | * Report Size (8), | ||
478 | * Report Count (7), | ||
479 | * Input (Variable), | ||
480 | * Usage (Azimuth), ; Azimuth (3Fh, dynamic value) | ||
481 | * Usage (Altitude), ; Altitude (40h, dynamic value) | ||
482 | * Logical Minimum (0), | ||
483 | * Logical Maximum (255), | ||
484 | * Report Size (8), | ||
485 | * Report Count (2), | ||
486 | * Feature (Variable), | ||
487 | * End Collection, | ||
488 | * Report ID (5), | ||
489 | * Usage Page (Digitizer), ; Digitizer (0Dh) | ||
490 | * Usage (Stylus), ; Stylus (20h, logical collection) | ||
491 | * Collection (Physical), | ||
492 | * Usage (00h), | ||
493 | * Logical Minimum (0), | ||
494 | * Logical Maximum (255), | ||
495 | * Report Size (8), | ||
496 | * Report Count (7), | ||
497 | * Input (Variable), | ||
498 | * End Collection, | ||
499 | * Report ID (10), | ||
500 | * Usage Page (Digitizer), ; Digitizer (0Dh) | ||
501 | * Usage (Stylus), ; Stylus (20h, logical collection) | ||
502 | * Collection (Physical), | ||
503 | * Usage (00h), | ||
504 | * Logical Minimum (0), | ||
505 | * Logical Maximum (255), | ||
506 | * Report Size (8), | ||
507 | * Report Count (7), | ||
508 | * Input (Variable), | ||
509 | * End Collection, | ||
510 | * Report ID (16), | ||
511 | * Usage (Stylus), ; Stylus (20h, logical collection) | ||
512 | * Collection (Physical), | ||
513 | * Usage (Tip Switch), ; Tip switch (42h, momentary control) | ||
514 | * Usage (Barrel Switch), ; Barrel switch (44h, momentary control) | ||
515 | * Usage (Invert), ; Invert (3Ch, momentary control) | ||
516 | * Usage (Eraser), ; Eraser (45h, momentary control) | ||
517 | * Usage (In Range), ; In range (32h, momentary control) | ||
518 | * Logical Minimum (0), | ||
519 | * Logical Maximum (1), | ||
520 | * Report Size (1), | ||
521 | * Report Count (5), | ||
522 | * Input (Variable), | ||
523 | * Report Count (3), | ||
524 | * Input (Constant, Variable), | ||
525 | * Usage Page (Desktop), ; Generic desktop controls (01h) | ||
526 | * Usage (X), ; X (30h, dynamic value) | ||
527 | * Report Size (16), | ||
528 | * Report Count (1), | ||
529 | * Push, | ||
530 | * Unit Exponent (13), | ||
531 | * Unit (Inch^3), | ||
532 | * Logical Minimum (0), | ||
533 | * Logical Maximum (12288), | ||
534 | * Physical Minimum (0), | ||
535 | * Physical Maximum (12288), | ||
536 | * Input (Variable), | ||
537 | * Usage (Y), ; Y (31h, dynamic value) | ||
538 | * Logical Minimum (0), | ||
539 | * Logical Maximum (9216), | ||
540 | * Physical Minimum (0), | ||
541 | * Physical Maximum (9216), | ||
542 | * Input (Variable), | ||
543 | * Usage Page (Digitizer), ; Digitizer (0Dh) | ||
544 | * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value) | ||
545 | * Logical Minimum (0), | ||
546 | * Logical Maximum (1023), | ||
547 | * Physical Minimum (0), | ||
548 | * Physical Maximum (1023), | ||
549 | * Input (Variable), | ||
550 | * End Collection, | ||
551 | * End Collection | ||
552 | */ | ||
553 | |||
554 | /* Size of the original report descriptor of Q Pad */ | ||
555 | #define Q_PAD_RDESC_ORIG_SIZE 241 | ||
556 | |||
557 | /* | ||
558 | * Fixed Q Pad descriptor. | ||
559 | * | ||
560 | * All the reports except the stylus report (ID 16) were removed as unused. | ||
561 | * The stylus buttons description was fixed. | ||
562 | */ | ||
563 | static __u8 q_pad_rdesc_fixed[] = { | ||
564 | 0x05, 0x0D, /* Usage Page (Digitizer), */ | ||
565 | 0x09, 0x02, /* Usage (Pen), */ | ||
566 | 0xA1, 0x01, /* Collection (Application), */ | ||
567 | 0x85, 0x10, /* Report ID (16), */ | ||
568 | 0x09, 0x20, /* Usage (Stylus), */ | ||
569 | 0xA0, /* Collection (Physical), */ | ||
570 | 0x09, 0x42, /* Usage (Tip Switch), */ | ||
571 | 0x09, 0x44, /* Usage (Barrel Switch), */ | ||
572 | 0x09, 0x46, /* Usage (Tablet Pick), */ | ||
573 | 0x15, 0x01, /* Logical Minimum (1), */ | ||
574 | 0x25, 0x03, /* Logical Maximum (3), */ | ||
575 | 0x75, 0x04, /* Report Size (4), */ | ||
576 | 0x95, 0x01, /* Report Count (1), */ | ||
577 | 0x80, /* Input, */ | ||
578 | 0x09, 0x32, /* Usage (In Range), */ | ||
579 | 0x14, /* Logical Minimum (0), */ | ||
580 | 0x25, 0x01, /* Logical Maximum (1), */ | ||
581 | 0x75, 0x01, /* Report Size (1), */ | ||
582 | 0x95, 0x01, /* Report Count (1), */ | ||
583 | 0x81, 0x02, /* Input (Variable), */ | ||
584 | 0x95, 0x03, /* Report Count (3), */ | ||
585 | 0x81, 0x03, /* Input (Constant, Variable), */ | ||
586 | 0x75, 0x10, /* Report Size (16), */ | ||
587 | 0x95, 0x01, /* Report Count (1), */ | ||
588 | 0x14, /* Logical Minimum (0), */ | ||
589 | 0xA4, /* Push, */ | ||
590 | 0x05, 0x01, /* Usage Page (Desktop), */ | ||
591 | 0x65, 0x13, /* Unit (Inch), */ | ||
592 | 0x55, 0xFD, /* Unit Exponent (-3), */ | ||
593 | 0x34, /* Physical Minimum (0), */ | ||
594 | 0x09, 0x30, /* Usage (X), */ | ||
595 | 0x46, 0x70, 0x17, /* Physical Maximum (6000), */ | ||
596 | 0x26, 0x00, 0x30, /* Logical Maximum (12288), */ | ||
597 | 0x81, 0x02, /* Input (Variable), */ | ||
598 | 0x09, 0x31, /* Usage (Y), */ | ||
599 | 0x46, 0x94, 0x11, /* Physical Maximum (4500), */ | ||
600 | 0x26, 0x00, 0x24, /* Logical Maximum (9216), */ | ||
601 | 0x81, 0x02, /* Input (Variable), */ | ||
602 | 0xB4, /* Pop, */ | ||
603 | 0x09, 0x30, /* Usage (Tip Pressure), */ | ||
604 | 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */ | ||
605 | 0x81, 0x02, /* Input (Variable), */ | ||
606 | 0xC0, /* End Collection, */ | ||
607 | 0xC0 /* End Collection */ | ||
608 | }; | ||
609 | |||
610 | /* | ||
427 | * Original Media Tablet 10.6 inch report descriptor. | 611 | * Original Media Tablet 10.6 inch report descriptor. |
428 | * | 612 | * |
429 | * There are at least two versions of this model in the wild. They are | 613 | * There are at least two versions of this model in the wild. They are |
@@ -1049,6 +1233,12 @@ static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
1049 | *rsize = sizeof(slim_tablet_12_1_inch_rdesc_fixed); | 1233 | *rsize = sizeof(slim_tablet_12_1_inch_rdesc_fixed); |
1050 | } | 1234 | } |
1051 | break; | 1235 | break; |
1236 | case USB_DEVICE_ID_WALTOP_Q_PAD: | ||
1237 | if (*rsize == Q_PAD_RDESC_ORIG_SIZE) { | ||
1238 | rdesc = q_pad_rdesc_fixed; | ||
1239 | *rsize = sizeof(q_pad_rdesc_fixed); | ||
1240 | } | ||
1241 | break; | ||
1052 | case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH: | 1242 | case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH: |
1053 | if (*rsize == MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE) { | 1243 | if (*rsize == MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE) { |
1054 | rdesc = media_tablet_10_6_inch_rdesc_fixed; | 1244 | rdesc = media_tablet_10_6_inch_rdesc_fixed; |
@@ -1071,6 +1261,8 @@ static const struct hid_device_id waltop_devices[] = { | |||
1071 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, | 1261 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, |
1072 | USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) }, | 1262 | USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) }, |
1073 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, | 1263 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, |
1264 | USB_DEVICE_ID_WALTOP_Q_PAD) }, | ||
1265 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, | ||
1074 | USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) }, | 1266 | USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) }, |
1075 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, | 1267 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, |
1076 | USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) }, | 1268 | USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) }, |