Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 89877e42827f16fa5f86b1df0c2860b1 > files > 2361

kernel-2.6.18-128.1.10.el5.src.rpm

From: Aristeu Rozanski <aris@redhat.com>
Date: Thu, 21 Aug 2008 09:39:14 -0400
Subject: [usb] wacom: add support for Cintiq 20WSX
Message-id: 20080821133911.887771000@redhat.com
O-Subject: [RHEL5.3 PATCH 3/3] wacom: add support for Cintiq 20WSX
Bugzilla: 248903
RH-Acked-by: Pete Zaitcev <zaitcev@redhat.com>
RH-Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=248903

This patch adds support for Cintiq 20WSX tablet.

Patch tested by the customer with success.

Upstream:
b345dc7da026016b65162b1ca7cfcd2c7212a285
0e1763f530af71bd82e58e407991a9ded6aae73e

diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
index 9c4de10..1756e4d 100644
--- a/drivers/usb/input/wacom.c
+++ b/drivers/usb/input/wacom.c
@@ -90,6 +90,7 @@ MODULE_LICENSE(DRIVER_LICENSE);
 #define STYLUS_DEVICE_ID	0x02
 #define CURSOR_DEVICE_ID	0x06
 #define ERASER_DEVICE_ID	0x0A
+#define PAD_DEVICE_ID           0x0F
 
 enum {
 	PENPARTNER = 0,
@@ -102,6 +103,7 @@ enum {
 	INTUOS312,
 	INTUOS319,
 	CINTIQ,
+	BEE,
 	MAX_TYPE
 };
 
@@ -630,13 +632,17 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
 		input_report_key(dev, BTN_5, (data[6] & 0x02));
 		input_report_key(dev, BTN_6, (data[6] & 0x04));
 		input_report_key(dev, BTN_7, (data[6] & 0x08));
+		input_report_key(dev, BTN_8, (data[5] & 0x10));
+		input_report_key(dev, BTN_9, (data[6] & 0x10));
 		input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
 		input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
 
-		if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) | data[2])
+		if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
+		    data[2] | (data[3] & 0x1f) | data[4])
 			input_report_key(dev, wacom->tool[1], 1);
 		else
 			input_report_key(dev, wacom->tool[1], 0);
+		input_report_abs(dev, ABS_MISC, PAD_DEVICE_ID);
 		input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff);
 		input_sync(dev);
 		goto exit;
@@ -669,13 +675,10 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs)
 		if (data[1] & 0x02) {
 			/* Rotation packet */
 			if (wacom->features->type >= INTUOS3S) {
-				/* I3 marker pen rotation reported as wheel
-				 * due to valuator limitation
-				 */
 				t = (data[6] << 3) | ((data[7] >> 5) & 7);
 				t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) :
 					((t-1) / 2 + 450)) : (450 - t / 2) ;
-				input_report_abs(dev, ABS_WHEEL, t);
+				input_report_abs(dev, ABS_Z, t);
 			} else {
 				/* 4D mouse rotation packet */
 				t = (data[6] << 3) | ((data[7] >> 5) & 7);
@@ -778,6 +781,7 @@ static struct wacom_features wacom_features[] = {
 	{ "Wacom Cintiq 21UX",   10, 87200, 65600, 1023, 63, CINTIQ,     wacom_intuos_irq },
 	{ "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 31, INTUOS,     wacom_intuos_irq },
 	{ "Wacom Intuos3 4x6",   10, 31496, 19685, 1023, 63, INTUOS3S,   wacom_intuos_irq },
+	{ "Wacom Cintiq 20WSX",  10, 86680, 54180, 1023, 63, BEE,	 wacom_intuos_irq },
 	{ }
 };
 
@@ -826,6 +830,7 @@ static struct usb_device_id wacom_ids[] = {
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
 	{ }
 };
 
@@ -910,6 +915,9 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 			input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom->features->distance_max, 0, 0);
 			break;
 
+		case BEE:
+			input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_8) | BIT(BTN_9);
+			/* fall through */
 		case INTUOS3:
 		case INTUOS312:
 		case INTUOS319:
@@ -921,6 +929,9 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 			input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
 			input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
 			input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
+			input_dev->absbit[0] |= BIT(ABS_RX) | BIT(ABS_Z);
+			input_dev->absmax[ABS_Z] = 899;
+			input_dev->absmin[ABS_Z] = -900;
 			/* fall through */
 		case INTUOS:
 			input_dev->evbit[0] |= BIT(EV_MSC) | BIT(EV_REL);