diff --git a/sys/dev/usb/ugraphire_rdesc.h b/sys/dev/usb/ugraphire_rdesc.h index 295f2a0db785..9c5a0c1a6cf7 100644 --- a/sys/dev/usb/ugraphire_rdesc.h +++ b/sys/dev/usb/ugraphire_rdesc.h @@ -26,7 +26,7 @@ * SUCH DAMAGE. */ -static uByte uhid_graphire_report_descr[] = { +static const uByte uhid_graphire_report_descr[] = { 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */ 0x09, 0x01, /* USAGE (Digitizer) */ 0xa1, 0x01, /* COLLECTION (Application) */ @@ -90,3 +90,87 @@ static uByte uhid_graphire_report_descr[] = { 0xb1, 0x02, /* FEATURE (Data,Var,Abs) */ 0xc0, /* END_COLLECTION */ }; + +static const uByte uhid_graphire3_4x5_report_descr[] = { + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ + 0x09, 0x02, /* USAGE (Mouse) */ + 0xa1, 0x01, /* COLLECTION (Application) */ + 0x85, 0x01, /* REPORT_ID (1) */ + 0x09, 0x01, /* USAGE (Pointer) */ + 0xa1, 0x00, /* COLLECTION (Physical) */ + 0x05, 0x09, /* USAGE_PAGE (Button) */ + 0x19, 0x01, /* USAGE_MINIMUM (Button 1) */ + 0x29, 0x03, /* USAGE_MAXIMUM (Button 3) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x95, 0x03, /* REPORT_COUNT (3) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x75, 0x05, /* REPORT_SIZE (5) */ + 0x81, 0x01, /* INPUT (Cnst,Ary,Abs) */ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ + 0x09, 0x30, /* USAGE (X) */ + 0x09, 0x31, /* USAGE (Y) */ + 0x09, 0x38, /* USAGE (Wheel) */ + 0x15, 0x81, /* LOGICAL_MINIMUM (-127) */ + 0x25, 0x7f, /* LOGICAL_MAXIMUM (127) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x03, /* REPORT_COUNT (3) */ + 0x81, 0x06, /* INPUT (Data,Var,Rel) */ + 0xc0, /* END_COLLECTION */ + 0xc0, /* END_COLLECTION */ + 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */ + 0x09, 0x01, /* USAGE (Pointer) */ + 0xa1, 0x01, /* COLLECTION (Applicaption) */ + 0x85, 0x02, /* REPORT_ID (2) */ + 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */ + 0x09, 0x01, /* USAGE (Digitizer) */ + 0xa1, 0x00, /* COLLECTION (Physical) */ + 0x09, 0x33, /* USAGE (Touch) */ + 0x09, 0x44, /* USAGE (Barrel Switch) */ + 0x09, 0x44, /* USAGE (Barrel Switch) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x95, 0x03, /* REPORT_COUNT (3) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x95, 0x02, /* REPORT_COUNT (2) */ + 0x81, 0x01, /* INPUT (Cnst,Ary,Abs) */ + 0x09, 0x3c, /* USAGE (Invert) */ + 0x09, 0x38, /* USAGE (Transducer Index) */ + 0x09, 0x32, /* USAGE (In Range) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x95, 0x03, /* REPORT_COUNT (3) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ + 0x09, 0x30, /* USAGE (X) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x26, 0xde, 0x27, /* LOGICAL_MAXIMUM (10206) */ + 0x75, 0x10, /* REPORT_SIZE (16) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ + 0x09, 0x31, /* USAGE (Y) */ + 0x26, 0xfe, 0x1c, /* LOGICAL_MAXIMUM (7422) */ + 0x75, 0x10, /* REPORT_SIZE (16) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ + 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */ + 0x09, 0x30, /* USAGE (Tip Pressure) */ + 0x26, 0xff, 0x01, /* LOGICAL_MAXIMUM (511) */ + 0x75, 0x10, /* REPORT_SIZE (16) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ + 0xc0, /* END_COLLECTION */ + 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */ + 0x09, 0x00, /* USAGE (Undefined) */ + 0x85, 0x02, /* REPORT_ID (2) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0xb1, 0x02, /* FEATURE (Data,Var,Abs) */ + 0x09, 0x00, /* USAGE (Undefined) */ + 0x85, 0x03, /* REPORT_ID (3) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0xb1, 0x02, /* FEATURE (Data,Var,Abs) */ + 0xc0 /* END_COLLECTION */ +}; diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 8fdf6d904e79..3b193fb9d427 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -220,7 +220,8 @@ USB_ATTACH(uhid) usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; int size; - void *descptr, *desc; + void *desc; + const void *descptr; usbd_status err; char devinfo[1024]; @@ -257,12 +258,25 @@ USB_ATTACH(uhid) sc->sc_ep_addr = ed->bEndpointAddress; descptr = NULL; - if (uaa->vendor == USB_VENDOR_WACOM && - uaa->product == USB_PRODUCT_WACOM_GRAPHIRE /* && - uaa->revision == 0x???? */) { /* XXX should use revision */ + if (uaa->vendor == USB_VENDOR_WACOM) { /* The report descriptor for the Wacom Graphire is broken. */ - size = sizeof uhid_graphire_report_descr; - descptr = uhid_graphire_report_descr; + if (uaa->product == USB_PRODUCT_WACOM_GRAPHIRE) { + size = sizeof uhid_graphire_report_descr; + descptr = uhid_graphire_report_descr; + } else if (uaa->product == USB_PRODUCT_WACOM_GRAPHIRE3_4X5) { + static uByte reportbuf[] = {2, 2, 2}; + + /* + * The Graphire3 needs 0x0202 to be written to + * feature report ID 2 before it'll start + * returning digitizer data. + */ + usbd_set_report(uaa->iface, UHID_FEATURE_REPORT, 2, + &reportbuf, sizeof reportbuf); + + size = sizeof uhid_graphire3_4x5_report_descr; + descptr = uhid_graphire3_4x5_report_descr; + } } else if (id->bInterfaceClass == UICLASS_VENDOR && id->bInterfaceSubClass == UISUBCLASS_XBOX360_CONTROLLER && id->bInterfaceProtocol == UIPROTO_XBOX360_GAMEPAD) { diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 788ece087541..20a87ff56140 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1593,7 +1593,7 @@ product VTECH RT2570 0x3012 RT2570 /* Wacom products */ product WACOM CT0405U 0x0000 CT-0405-U Tablet product WACOM GRAPHIRE 0x0010 Graphire -product WACOM GRAPHIRE3 0x0013 Graphire 3 +product WACOM GRAPHIRE3_4X5 0x0013 Graphire 3 4x5 product WACOM INTUOSA5 0x0021 Intuos A5 product WACOM GD0912U 0x0022 Intuos 9x12 Graphics Tablet diff --git a/sys/dev/usb/uxb360gp_rdesc.h b/sys/dev/usb/uxb360gp_rdesc.h index 1aba94472319..d51b52f807e8 100644 --- a/sys/dev/usb/uxb360gp_rdesc.h +++ b/sys/dev/usb/uxb360gp_rdesc.h @@ -30,7 +30,7 @@ * The descriptor has no output report format, thus preventing you from * controlling the LEDs and the built-in rumblers. */ -static uByte uhid_xb360gp_report_descr[] = { +static const uByte uhid_xb360gp_report_descr[] = { 0x05, 0x01, /* USAGE PAGE (Generic Desktop) */ 0x09, 0x05, /* USAGE (Gamepad) */ 0xa1, 0x01, /* COLLECTION (Application) */