aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-uclogic.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2011-07-06 02:23:41 -0400
committerJiri Kosina <jkosina@suse.cz>2011-07-11 08:37:24 -0400
commit6be914f11db8e88d11b08d6c496624dbbd642d80 (patch)
tree744b4c3868ed4e0fe297fe7f9171c5145b327c81 /drivers/hid/hid-uclogic.c
parentd946e65e2ab885c05b8cacf292be65fa292d08f6 (diff)
HID: uclogic: Add support for UC-Logic WP1062
Add support for UC-Logic Tablet WP1062 by fixing its report descriptor. This tablet is sold as Monoprice 10X6.25 Inches Graphic Drawing Tablet. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-uclogic.c')
-rw-r--r--drivers/hid/hid-uclogic.c195
1 files changed, 195 insertions, 0 deletions
diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c
index 05fdc85a76e5..e15732f1a22d 100644
--- a/drivers/hid/hid-uclogic.c
+++ b/drivers/hid/hid-uclogic.c
@@ -343,6 +343,193 @@ static __u8 wp8060u_rdesc_fixed[] = {
343}; 343};
344 344
345/* 345/*
346 * Original WP1062 report descriptor.
347 *
348 * Only report ID 9 is actually used.
349 *
350 * Usage Page (Digitizer), ; Digitizer (0Dh)
351 * Usage (Pen), ; Pen (02h, application collection)
352 * Collection (Application),
353 * Report ID (7),
354 * Usage (Stylus), ; Stylus (20h, logical collection)
355 * Collection (Physical),
356 * Usage (Tip Switch), ; Tip switch (42h, momentary control)
357 * Usage (Barrel Switch), ; Barrel switch (44h, momentary control)
358 * Usage (Eraser), ; Eraser (45h, momentary control)
359 * Logical Minimum (0),
360 * Logical Maximum (1),
361 * Report Size (1),
362 * Report Count (3),
363 * Input (Variable),
364 * Report Count (3),
365 * Input (Constant, Variable),
366 * Usage (In Range), ; In range (32h, momentary control)
367 * Report Count (1),
368 * Input (Variable),
369 * Report Count (1),
370 * Input (Constant, Variable),
371 * Usage Page (Desktop), ; Generic desktop controls (01h)
372 * Usage (X), ; X (30h, dynamic value)
373 * Report Size (16),
374 * Report Count (1),
375 * Push,
376 * Unit Exponent (13),
377 * Unit (Inch),
378 * Physical Minimum (0),
379 * Physical Maximum (10000),
380 * Logical Maximum (20000),
381 * Input (Variable),
382 * Usage (Y), ; Y (31h, dynamic value)
383 * Physical Maximum (6583),
384 * Logical Maximum (13166),
385 * Input (Variable),
386 * Pop,
387 * Usage Page (Digitizer), ; Digitizer (0Dh)
388 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
389 * Logical Maximum (1023),
390 * Input (Variable),
391 * Report Size (16),
392 * End Collection,
393 * End Collection,
394 * Usage Page (Desktop), ; Generic desktop controls (01h)
395 * Usage (Mouse), ; Mouse (02h, application collection)
396 * Collection (Application),
397 * Report ID (8),
398 * Usage (Pointer), ; Pointer (01h, physical collection)
399 * Collection (Physical),
400 * Usage Page (Button), ; Button (09h)
401 * Usage Minimum (01h),
402 * Usage Maximum (03h),
403 * Logical Minimum (0),
404 * Logical Maximum (1),
405 * Report Count (3),
406 * Report Size (1),
407 * Input (Variable),
408 * Report Count (5),
409 * Input (Constant),
410 * Usage Page (Desktop), ; Generic desktop controls (01h)
411 * Usage (X), ; X (30h, dynamic value)
412 * Usage (Y), ; Y (31h, dynamic value)
413 * Usage (Wheel), ; Wheel (38h, dynamic value)
414 * Usage (00h),
415 * Logical Minimum (-127),
416 * Logical Maximum (127),
417 * Report Size (8),
418 * Report Count (4),
419 * Input (Variable, Relative),
420 * End Collection,
421 * End Collection,
422 * Usage Page (Desktop), ; Generic desktop controls (01h)
423 * Usage (Mouse), ; Mouse (02h, application collection)
424 * Collection (Application),
425 * Report ID (9),
426 * Usage (Pointer), ; Pointer (01h, physical collection)
427 * Collection (Physical),
428 * Usage Page (Button), ; Button (09h)
429 * Usage Minimum (01h),
430 * Usage Maximum (03h),
431 * Logical Minimum (0),
432 * Logical Maximum (1),
433 * Report Count (3),
434 * Report Size (1),
435 * Input (Variable),
436 * Report Count (4),
437 * Input (Constant),
438 * Usage Page (Digitizer), ; Digitizer (0Dh)
439 * Usage (In Range), ; In range (32h, momentary control)
440 * Report Count (1),
441 * Input (Variable),
442 * Usage Page (Desktop), ; Generic desktop controls (01h)
443 * Usage (X), ; X (30h, dynamic value)
444 * Report Size (16),
445 * Report Count (1),
446 * Push,
447 * Unit Exponent (13),
448 * Unit (Inch),
449 * Physical Minimum (0),
450 * Physical Maximum (10000),
451 * Logical Maximum (20000),
452 * Input (Variable),
453 * Usage (Y), ; Y (31h, dynamic value)
454 * Physical Maximum (6583),
455 * Logical Maximum (13166),
456 * Input (Variable),
457 * Pop,
458 * Usage Page (Digitizer), ; Digitizer (0Dh)
459 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
460 * Logical Maximum (1023),
461 * Report Count (1),
462 * Report Size (16),
463 * Input (Variable),
464 * End Collection,
465 * End Collection,
466 * Usage Page (Desktop), ; Generic desktop controls (01h)
467 * Usage (00h),
468 * Collection (Application),
469 * Report ID (4),
470 * Logical Minimum (0),
471 * Logical Maximum (255),
472 * Usage (00h),
473 * Report Size (8),
474 * Report Count (3),
475 * Feature (Variable),
476 * End Collection
477 */
478
479/* Size of the original descriptor of WP1062 tablet */
480#define WP1062_RDESC_ORIG_SIZE 254
481
482/*
483 * Fixed WP1062 report descriptor.
484 *
485 * Removed unused reports, corrected second barrel button usage code, physical
486 * units.
487 */
488static __u8 wp1062_rdesc_fixed[] = {
489 0x05, 0x0D, /* Usage Page (Digitizer), */
490 0x09, 0x02, /* Usage (Pen), */
491 0xA1, 0x01, /* Collection (Application), */
492 0x85, 0x09, /* Report ID (9), */
493 0x09, 0x20, /* Usage (Stylus), */
494 0xA0, /* Collection (Physical), */
495 0x75, 0x01, /* Report Size (1), */
496 0x09, 0x42, /* Usage (Tip Switch), */
497 0x09, 0x44, /* Usage (Barrel Switch), */
498 0x09, 0x46, /* Usage (Tablet Pick), */
499 0x14, /* Logical Minimum (0), */
500 0x25, 0x01, /* Logical Maximum (1), */
501 0x95, 0x03, /* Report Count (3), */
502 0x81, 0x02, /* Input (Variable), */
503 0x95, 0x04, /* Report Count (4), */
504 0x81, 0x01, /* Input (Constant), */
505 0x09, 0x32, /* Usage (In Range), */
506 0x95, 0x01, /* Report Count (1), */
507 0x81, 0x02, /* Input (Variable), */
508 0x75, 0x10, /* Report Size (16), */
509 0x95, 0x01, /* Report Count (1), */
510 0x14, /* Logical Minimum (0), */
511 0xA4, /* Push, */
512 0x05, 0x01, /* Usage Page (Desktop), */
513 0x55, 0xFD, /* Unit Exponent (-3), */
514 0x65, 0x13, /* Unit (Inch), */
515 0x34, /* Physical Minimum (0), */
516 0x09, 0x30, /* Usage (X), */
517 0x46, 0x10, 0x27, /* Physical Maximum (10000), */
518 0x26, 0x20, 0x4E, /* Logical Maximum (20000), */
519 0x81, 0x02, /* Input (Variable), */
520 0x09, 0x31, /* Usage (Y), */
521 0x46, 0xB7, 0x19, /* Physical Maximum (6583), */
522 0x26, 0x6E, 0x33, /* Logical Maximum (13166), */
523 0x81, 0x02, /* Input (Variable), */
524 0xB4, /* Pop, */
525 0x09, 0x30, /* Usage (Tip Pressure), */
526 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
527 0x81, 0x02, /* Input (Variable), */
528 0xC0, /* End Collection, */
529 0xC0 /* End Collection */
530};
531
532/*
346 * Original PF1209 report descriptor. 533 * Original PF1209 report descriptor.
347 * 534 *
348 * The descriptor is similar to WPXXXXU descriptors, with an addition of a 535 * The descriptor is similar to WPXXXXU descriptors, with an addition of a
@@ -584,6 +771,12 @@ static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
584 *rsize = sizeof(wp8060u_rdesc_fixed); 771 *rsize = sizeof(wp8060u_rdesc_fixed);
585 } 772 }
586 break; 773 break;
774 case USB_DEVICE_ID_UCLOGIC_TABLET_WP1062:
775 if (*rsize == WP1062_RDESC_ORIG_SIZE) {
776 rdesc = wp1062_rdesc_fixed;
777 *rsize = sizeof(wp1062_rdesc_fixed);
778 }
779 break;
587 } 780 }
588 781
589 return rdesc; 782 return rdesc;
@@ -598,6 +791,8 @@ static const struct hid_device_id uclogic_devices[] = {
598 USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) }, 791 USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) },
599 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, 792 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
600 USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U) }, 793 USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U) },
794 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
795 USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) },
601 { } 796 { }
602}; 797};
603MODULE_DEVICE_TABLE(hid, uclogic_devices); 798MODULE_DEVICE_TABLE(hid, uclogic_devices);