Module Name:    src
Committed By:   ryoon
Date:           Sat Sep  2 04:35:51 UTC 2017

Modified Files:
        src/sys/dev/usb: ugraphire_rdesc.h uhidev.c

Log Message:
Support some Wacom pen tablets:

* Graphire (pen)
* Graphire2 (pen)
* Intuos2 A4 (pen)
* Intuos Art (pen, no finger touch)

Remove report descriptor override workaround for
Graphire and Graphire2.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/ugraphire_rdesc.h
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/usb/uhidev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ugraphire_rdesc.h
diff -u src/sys/dev/usb/ugraphire_rdesc.h:1.9 src/sys/dev/usb/ugraphire_rdesc.h:1.10
--- src/sys/dev/usb/ugraphire_rdesc.h:1.9	Fri Dec 23 00:51:46 2011
+++ src/sys/dev/usb/ugraphire_rdesc.h	Sat Sep  2 04:35:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugraphire_rdesc.h,v 1.9 2011/12/23 00:51:46 jakllsch Exp $	*/
+/*	$NetBSD: ugraphire_rdesc.h,v 1.10 2017/09/02 04:35:51 ryoon Exp $	*/
 /*
  * Copyright (c) 2000 Nick Hibma <n_hi...@freebsd.org>
  * All rights reserved.
@@ -26,8 +26,6 @@
  */
 
 /* Tested with 
- * - Graphire
- * - Graphire2
  * - Graphire3 4x5
  * - Graphire3 6x8
  * - Graphire4 4x5

Index: src/sys/dev/usb/uhidev.c
diff -u src/sys/dev/usb/uhidev.c:1.71 src/sys/dev/usb/uhidev.c:1.72
--- src/sys/dev/usb/uhidev.c:1.71	Sun Aug 13 22:29:42 2017
+++ src/sys/dev/usb/uhidev.c	Sat Sep  2 04:35:51 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhidev.c,v 1.71 2017/08/13 22:29:42 jakllsch Exp $	*/
+/*	$NetBSD: uhidev.c,v 1.72 2017/09/02 04:35:51 ryoon Exp $	*/
 
 /*
  * Copyright (c) 2001, 2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.71 2017/08/13 22:29:42 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.72 2017/09/02 04:35:51 ryoon Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -152,6 +152,15 @@ uhidev_attach(device_t parent, device_t 
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
+	if (uiaa->uiaa_vendor == USB_VENDOR_WACOM) {
+		if (uiaa->uiaa_product == USB_PRODUCT_WACOM_XD0912U) {
+		/*
+		 * Wacom Intuos2 (XD-0912-U) requires longer idle time to
+		 * initialize the device with 0x0202.
+		 */
+			DELAY(500000);
+		}
+	}
 	(void)usbd_set_idle(iface, 0, 0);
 
 	if ((usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_NO_SET_PROTO) == 0)
@@ -202,12 +211,10 @@ uhidev_attach(device_t parent, device_t 
 	/* XXX need to extend this */
 	descptr = NULL;
 	if (uiaa->uiaa_vendor == USB_VENDOR_WACOM) {
-		static uByte reportbuf[] = {2, 2, 2};
+		static uByte reportbuf[3];
 
 		/* The report descriptor for the Wacom Graphire is broken. */
 		switch (uiaa->uiaa_product) {
-		case USB_PRODUCT_WACOM_GRAPHIRE:
-		case USB_PRODUCT_WACOM_GRAPHIRE2:
 		case USB_PRODUCT_WACOM_GRAPHIRE3_4X5:
 		case USB_PRODUCT_WACOM_GRAPHIRE3_6X8:
 		case USB_PRODUCT_WACOM_GRAPHIRE4_4X5: /* The 6x8 too? */
@@ -216,12 +223,23 @@ uhidev_attach(device_t parent, device_t 
 			 * feature report ID 2 before it'll start
 			 * returning digitizer data.
 			 */
+			reportbuf[0] = 0x02;
+			reportbuf[1] = 0x02;
 			usbd_set_report(uiaa->uiaa_iface, UHID_FEATURE_REPORT, 2,
-			    &reportbuf, sizeof(reportbuf));
+			    &reportbuf, 2);
 
 			size = sizeof(uhid_graphire3_4x5_report_descr);
 			descptr = uhid_graphire3_4x5_report_descr;
 			break;
+		case USB_PRODUCT_WACOM_GRAPHIRE:
+		case USB_PRODUCT_WACOM_GRAPHIRE2:
+		case USB_PRODUCT_WACOM_XD0912U:
+		case USB_PRODUCT_WACOM_CTH690K0:
+			reportbuf[0] = 0x02;
+			reportbuf[1] = 0x02;
+			usbd_set_report(uiaa->uiaa_iface, UHID_FEATURE_REPORT, 2,
+			    &reportbuf, 2);
+			break;
 		default:
 			/* Keep descriptor */
 			break;

Reply via email to