public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3)
@ 2010-09-04 13:42 Henrik Rydberg
  2010-09-04 13:42 ` [PATCH 1/5] input: wacom: Add fuzz parameters to features Henrik Rydberg
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Henrik Rydberg @ 2010-09-04 13:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Chris Bagwell, linux-input, linux-kernel,
	Henrik Rydberg

This the fourth iteration of the Bamboo patches. Hopefully no big
surprises.  The ordering has changed to allow setting the pressure_max
which is not parsed in the hid function. Ping's button mapping has
been implemented, relying on middle-button emulation instead.  The
lowres quirks now apply to all touch devices in the family.

Cheers,
Henrik

Henrik Rydberg (4):
  input: wacom: Add fuzz parameters to features
  input: wacom: Collect device quirks into single function (rev2)
  input: wacom: Add support for the Bamboo Touch trackpad (rev4)
  input: wacom: Add a quirk for lowres Bamboo devices (rev2)

Ping Cheng (1):
  input: wacom: Parse the Bamboo device family

 drivers/input/tablet/wacom.h     |    1 +
 drivers/input/tablet/wacom_sys.c |   57 +++++++++++++-----
 drivers/input/tablet/wacom_wac.c |  123 +++++++++++++++++++++++++++++++++++++-
 drivers/input/tablet/wacom_wac.h |   14 ++++
 4 files changed, 176 insertions(+), 19 deletions(-)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/5] input: wacom: Add fuzz parameters to features
  2010-09-04 13:42 [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Henrik Rydberg
@ 2010-09-04 13:42 ` Henrik Rydberg
  2010-09-04 13:43 ` [PATCH 2/5] input: wacom: Parse the Bamboo device family Henrik Rydberg
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Henrik Rydberg @ 2010-09-04 13:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Chris Bagwell, linux-input, linux-kernel,
	Henrik Rydberg

The signal-to-noise ratio varies between devices, but currently all
devices are treated the same way. Add fuzz parameters to the feature
struct, allowing for tailored treatment of devices.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/input/tablet/wacom_sys.c |    6 +++++-
 drivers/input/tablet/wacom_wac.c |    9 ++++++---
 drivers/input/tablet/wacom_wac.h |    4 ++++
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 42ba369..e510e4f 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -333,8 +333,12 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
 	struct usb_host_interface *interface = intf->cur_altsetting;
 	struct hid_descriptor *hid_desc;
 
-	/* default device to penabled */
+	/* default features */
 	features->device_type = BTN_TOOL_PEN;
+	features->x_fuzz = 4;
+	features->y_fuzz = 4;
+	features->pressure_fuzz = 0;
+	features->distance_fuzz = 0;
 
 	/* only Tablet PCs need to retrieve the info */
 	if ((features->type != TABLETPC) && (features->type != TABLETPC2FG))
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 40d77ba..bfe5654 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -951,9 +951,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
 
 	__set_bit(BTN_TOUCH, input_dev->keybit);
 
-	input_set_abs_params(input_dev, ABS_X, 0, features->x_max, 4, 0);
-	input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 4, 0);
-	input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 0, 0);
+	input_set_abs_params(input_dev, ABS_X, 0, features->x_max,
+			     features->x_fuzz, 0);
+	input_set_abs_params(input_dev, ABS_Y, 0, features->y_max,
+			     features->y_fuzz, 0);
+	input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
+			     features->pressure_fuzz, 0);
 
 	__set_bit(ABS_MISC, input_dev->absbit);
 
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 99e1a54..d769e9a 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -73,6 +73,10 @@ struct wacom_features {
 	int y_phy;
 	unsigned char unit;
 	unsigned char unitExpo;
+	int x_fuzz;
+	int y_fuzz;
+	int pressure_fuzz;
+	int distance_fuzz;
 };
 
 struct wacom_shared {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/5] input: wacom: Parse the Bamboo device family
  2010-09-04 13:42 [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Henrik Rydberg
  2010-09-04 13:42 ` [PATCH 1/5] input: wacom: Add fuzz parameters to features Henrik Rydberg
@ 2010-09-04 13:43 ` Henrik Rydberg
  2010-09-04 13:43 ` [PATCH 3/5] input: wacom: Collect device quirks into single function (rev2) Henrik Rydberg
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Henrik Rydberg @ 2010-09-04 13:43 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Chris Bagwell, linux-input, linux-kernel, Ping Cheng,
	Henrik Rydberg

From: Ping Cheng <pinglinux@gmail.com>

The Bamboo devices have multiple interfaces which need to be setup
separately. Use the HID parsing mechanism to achieve that.

Signed-off-by: Ping Cheng <pinglinux@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/input/tablet/wacom_sys.c |   44 ++++++++++++++++++++++++++++++-------
 drivers/input/tablet/wacom_wac.h |    2 +
 2 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index e510e4f..98cba08 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -195,17 +195,30 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
 							features->pktlen = WACOM_PKGLEN_TPC2FG;
 							features->device_type = BTN_TOOL_TRIPLETAP;
 						}
-						features->x_max =
-							get_unaligned_le16(&report[i + 3]);
-						features->x_phy =
-							get_unaligned_le16(&report[i + 6]);
-						features->unit = report[i + 9];
-						features->unitExpo = report[i + 11];
-						i += 12;
+						if (features->type == BAMBOO_PT) {
+							/* need to reset back */
+							features->pktlen = WACOM_PKGLEN_BBTOUCH;
+							features->device_type = BTN_TOOL_TRIPLETAP;
+							features->x_phy =
+								get_unaligned_le16(&report[i + 5]);
+							features->x_max =
+								get_unaligned_le16(&report[i + 8]);
+							i += 15;
+						} else {
+							features->x_max =
+								get_unaligned_le16(&report[i + 3]);
+							features->x_phy =
+								get_unaligned_le16(&report[i + 6]);
+							features->unit = report[i + 9];
+							features->unitExpo = report[i + 11];
+							i += 12;
+						}
 					} else if (pen) {
 						/* penabled only accepts exact bytes of data */
 						if (features->type == TABLETPC2FG)
 							features->pktlen = WACOM_PKGLEN_GRAPHIRE;
+						if (features->type == BAMBOO_PT)
+							features->pktlen = WACOM_PKGLEN_BBFUN;
 						features->device_type = BTN_TOOL_PEN;
 						features->x_max =
 							get_unaligned_le16(&report[i + 3]);
@@ -234,6 +247,15 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
 							features->y_phy =
 								get_unaligned_le16(&report[i + 6]);
 							i += 7;
+						} else if (features->type == BAMBOO_PT) {
+							/* need to reset back */
+							features->pktlen = WACOM_PKGLEN_BBTOUCH;
+							features->device_type = BTN_TOOL_TRIPLETAP;
+							features->y_phy =
+								get_unaligned_le16(&report[i + 3]);
+							features->y_max =
+								get_unaligned_le16(&report[i + 6]);
+							i += 12;
 						} else {
 							features->y_max =
 								features->x_max;
@@ -245,6 +267,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
 						/* penabled only accepts exact bytes of data */
 						if (features->type == TABLETPC2FG)
 							features->pktlen = WACOM_PKGLEN_GRAPHIRE;
+						if (features->type == BAMBOO_PT)
+							features->pktlen = WACOM_PKGLEN_BBFUN;
 						features->device_type = BTN_TOOL_PEN;
 						features->y_max =
 							get_unaligned_le16(&report[i + 3]);
@@ -341,7 +365,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
 	features->distance_fuzz = 0;
 
 	/* only Tablet PCs need to retrieve the info */
-	if ((features->type != TABLETPC) && (features->type != TABLETPC2FG))
+	if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) &&
+	    (features->type != BAMBOO_PT))
 		goto out;
 
 	if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
@@ -499,7 +524,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 
 	strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
 
-	if (features->type == TABLETPC || features->type == TABLETPC2FG) {
+	if (features->type == TABLETPC || features->type == TABLETPC2FG ||
+	    features->type == BAMBOO_PT) {
 		/* Append the device type to the name */
 		strlcat(wacom_wac->name,
 			features->device_type == BTN_TOOL_PEN ?
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index d769e9a..fb30895 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -21,6 +21,7 @@
 #define WACOM_PKGLEN_INTUOS	10
 #define WACOM_PKGLEN_TPC1FG	 5
 #define WACOM_PKGLEN_TPC2FG	14
+#define WACOM_PKGLEN_BBTOUCH	20
 
 /* device IDs */
 #define STYLUS_DEVICE_ID	0x02
@@ -44,6 +45,7 @@ enum {
 	PTU,
 	PL,
 	DTU,
+	BAMBOO_PT,
 	INTUOS,
 	INTUOS3S,
 	INTUOS3,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/5] input: wacom: Collect device quirks into single function (rev2)
  2010-09-04 13:42 [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Henrik Rydberg
  2010-09-04 13:42 ` [PATCH 1/5] input: wacom: Add fuzz parameters to features Henrik Rydberg
  2010-09-04 13:43 ` [PATCH 2/5] input: wacom: Parse the Bamboo device family Henrik Rydberg
@ 2010-09-04 13:43 ` Henrik Rydberg
  2010-09-04 13:43 ` [PATCH 4/5] input: wacom: Add support for the Bamboo Touch trackpad (rev4) Henrik Rydberg
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Henrik Rydberg @ 2010-09-04 13:43 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Chris Bagwell, linux-input, linux-kernel,
	Henrik Rydberg

Collect device-specific code into a single function, and use quirks to
flag specific behavior instead.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/input/tablet/wacom.h     |    1 +
 drivers/input/tablet/wacom_sys.c |   11 +++--------
 drivers/input/tablet/wacom_wac.c |   16 ++++++++++++++++
 drivers/input/tablet/wacom_wac.h |    4 ++++
 4 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index 284dfaa..de5adb1 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -118,6 +118,7 @@ struct wacom {
 extern const struct usb_device_id wacom_ids[];
 
 void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len);
+void wacom_setup_device_quirks(struct wacom_features *features);
 void wacom_setup_input_capabilities(struct input_dev *input_dev,
 				    struct wacom_wac *wacom_wac);
 #endif
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 98cba08..fc6fd53 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -381,12 +381,6 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
 	if (error)
 		goto out;
 
-	/* touch device found but size is not defined. use default */
-	if (features->device_type == BTN_TOOL_DOUBLETAP && !features->x_max) {
-		features->x_max = 1023;
-		features->y_max = 1023;
-	}
-
  out:
 	return error;
 }
@@ -522,10 +516,11 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 	if (error)
 		goto fail2;
 
+	wacom_setup_device_quirks(features);
+
 	strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
 
-	if (features->type == TABLETPC || features->type == TABLETPC2FG ||
-	    features->type == BAMBOO_PT) {
+	if (features->quirks & WACOM_QUIRK_MULTI_INPUT) {
 		/* Append the device type to the name */
 		strlcat(wacom_wac->name,
 			features->device_type == BTN_TOOL_PEN ?
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index bfe5654..ca18b4d 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -941,6 +941,22 @@ static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
 	input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);
 }
 
+
+void wacom_setup_device_quirks(struct wacom_features *features)
+{
+
+	/* touch device found but size is not defined. use default */
+	if (features->device_type == BTN_TOOL_DOUBLETAP && !features->x_max) {
+		features->x_max = 1023;
+		features->y_max = 1023;
+	}
+
+	/* these device have multiple inputs */
+	if (features->type == TABLETPC || features->type == TABLETPC2FG ||
+	    features->type == BAMBOO_PT)
+		features->quirks |= WACOM_QUIRK_MULTI_INPUT;
+}
+
 void wacom_setup_input_capabilities(struct input_dev *input_dev,
 				    struct wacom_wac *wacom_wac)
 {
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index fb30895..6a1ff10 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -38,6 +38,9 @@
 #define WACOM_REPORT_TPC1FG		6
 #define WACOM_REPORT_TPC2FG		13
 
+/* device quirks */
+#define WACOM_QUIRK_MULTI_INPUT		0x0001
+
 enum {
 	PENPARTNER = 0,
 	GRAPHIRE,
@@ -79,6 +82,7 @@ struct wacom_features {
 	int y_fuzz;
 	int pressure_fuzz;
 	int distance_fuzz;
+	unsigned quirks;
 };
 
 struct wacom_shared {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/5] input: wacom: Add support for the Bamboo Touch trackpad (rev4)
  2010-09-04 13:42 [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Henrik Rydberg
                   ` (2 preceding siblings ...)
  2010-09-04 13:43 ` [PATCH 3/5] input: wacom: Collect device quirks into single function (rev2) Henrik Rydberg
@ 2010-09-04 13:43 ` Henrik Rydberg
  2010-09-05 10:04   ` Henrik Rydberg
  2010-09-04 13:43 ` [PATCH 5/5] input: wacom: Add a quirk for lowres Bamboo devices (rev2) Henrik Rydberg
  2010-09-04 21:24 ` [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Ping Cheng
  5 siblings, 1 reply; 10+ messages in thread
From: Henrik Rydberg @ 2010-09-04 13:43 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Chris Bagwell, linux-input, linux-kernel,
	Henrik Rydberg

Add support for the Bamboo Touch trackpad, and make it work with
both the Synaptics X Driver and the Multitouch X Driver. The device
uses MT slots internally, so the choice of protocol is a given.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/input/tablet/wacom_wac.c |   88 ++++++++++++++++++++++++++++++++++++++
 drivers/input/tablet/wacom_wac.h |    3 +
 2 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index ca18b4d..97295aa 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -855,6 +855,54 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
 	return retval;
 }
 
+static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
+{
+	static int trkid;
+	struct input_dev *input = wacom->input;
+	unsigned char *data = wacom->data;
+	int sp = 0, sx = 0, sy = 0, count = 0;
+	int i;
+
+	if (len != WACOM_PKGLEN_BBTOUCH)
+		return 0;
+
+	for (i = 0; i < 2; i++) {
+		int p = data[9 * i + 2];
+		input_mt_slot(input, i);
+		if (p) {
+			int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
+			int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
+			input_report_abs(input, ABS_MT_PRESSURE, p);
+			input_report_abs(input, ABS_MT_POSITION_X, x);
+			input_report_abs(input, ABS_MT_POSITION_Y, y);
+			if (wacom->id[i] < 0)
+				wacom->id[i] = trkid++ & MAX_TRACKING_ID;
+			if (!count++)
+				sp = p, sx = x, sy = y;
+		} else {
+			wacom->id[i] = -1;
+		}
+		input_report_abs(input, ABS_MT_TRACKING_ID, wacom->id[i]);
+	}
+
+	input_report_key(input, BTN_TOUCH, count > 0);
+	input_report_key(input, BTN_TOOL_FINGER, count == 1);
+	input_report_key(input, BTN_TOOL_DOUBLETAP, count == 2);
+
+	input_report_abs(input, ABS_PRESSURE, sp);
+	input_report_abs(input, ABS_X, sx);
+	input_report_abs(input, ABS_Y, sy);
+
+	input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
+	input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
+	input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
+	input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
+
+	input_sync(input);
+
+	return 0;
+}
+
 void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
 {
 	bool sync;
@@ -900,6 +948,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
 		sync = wacom_tpc_irq(wacom_wac, len);
 		break;
 
+	case BAMBOO_PT:
+		sync = wacom_bpt_irq(wacom_wac, len);
+		break;
+
 	default:
 		sync = false;
 		break;
@@ -955,6 +1007,12 @@ void wacom_setup_device_quirks(struct wacom_features *features)
 	if (features->type == TABLETPC || features->type == TABLETPC2FG ||
 	    features->type == BAMBOO_PT)
 		features->quirks |= WACOM_QUIRK_MULTI_INPUT;
+
+	/* quirks for bamboo touch */
+	if (features->type == BAMBOO_PT) {
+		features->pressure_max = 256;
+		features->pressure_fuzz = 16;
+	}
 }
 
 void wacom_setup_input_capabilities(struct input_dev *input_dev,
@@ -1095,6 +1153,33 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
 	case PENPARTNER:
 		__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
 		break;
+
+	case BAMBOO_PT:
+		__clear_bit(ABS_MISC, input_dev->absbit);
+
+		if (features->device_type == BTN_TOOL_TRIPLETAP) {
+			__set_bit(BTN_LEFT, input_dev->keybit);
+			__set_bit(BTN_FORWARD, input_dev->keybit);
+			__set_bit(BTN_BACK, input_dev->keybit);
+			__set_bit(BTN_RIGHT, input_dev->keybit);
+
+			__set_bit(BTN_TOOL_FINGER, input_dev->keybit);
+			__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
+
+			input_mt_create_slots(input_dev, 2);
+			input_set_abs_params(input_dev, ABS_MT_POSITION_X,
+					     0, features->x_max,
+					     features->x_fuzz, 0);
+			input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
+					     0, features->y_max,
+					     features->y_fuzz, 0);
+			input_set_abs_params(input_dev, ABS_MT_PRESSURE,
+					     0, features->pressure_max,
+					     features->pressure_fuzz, 0);
+			input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0,
+					     MAX_TRACKING_ID, 0, 0);
+		}
+		break;
 	}
 }
 
@@ -1232,6 +1317,8 @@ static const struct wacom_features wacom_features_0xE3 =
 	{ "Wacom ISDv4 E3",       WACOM_PKGLEN_TPC2FG,    26202, 16325,  255,  0, TABLETPC2FG };
 static const struct wacom_features wacom_features_0x47 =
 	{ "Wacom Intuos2 6x8",    WACOM_PKGLEN_INTUOS,    20320, 16240, 1023, 31, INTUOS };
+static struct wacom_features wacom_features_0xD0 =
+	{ "Wacom Bamboo 2FG",     WACOM_PKGLEN_BBFUN,     14720,  9200, 1023, 63, BAMBOO_PT };
 
 #define USB_DEVICE_WACOM(prod)					\
 	USB_DEVICE(USB_VENDOR_ID_WACOM, prod),			\
@@ -1296,6 +1383,7 @@ const struct usb_device_id wacom_ids[] = {
 	{ USB_DEVICE_WACOM(0xC6) },
 	{ USB_DEVICE_WACOM(0xC7) },
 	{ USB_DEVICE_WACOM(0xCE) },
+	{ USB_DEVICE_WACOM(0xD0) },
 	{ USB_DEVICE_WACOM(0xF0) },
 	{ USB_DEVICE_WACOM(0xCC) },
 	{ USB_DEVICE_WACOM(0x90) },
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 6a1ff10..816ab0f 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -41,6 +41,9 @@
 /* device quirks */
 #define WACOM_QUIRK_MULTI_INPUT		0x0001
 
+/* largest reported tracking id */
+#define MAX_TRACKING_ID			0xfff
+
 enum {
 	PENPARTNER = 0,
 	GRAPHIRE,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/5] input: wacom: Add a quirk for lowres Bamboo devices (rev2)
  2010-09-04 13:42 [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Henrik Rydberg
                   ` (3 preceding siblings ...)
  2010-09-04 13:43 ` [PATCH 4/5] input: wacom: Add support for the Bamboo Touch trackpad (rev4) Henrik Rydberg
@ 2010-09-04 13:43 ` Henrik Rydberg
  2010-09-04 21:24 ` [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Ping Cheng
  5 siblings, 0 replies; 10+ messages in thread
From: Henrik Rydberg @ 2010-09-04 13:43 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Chris Bagwell, linux-input, linux-kernel,
	Henrik Rydberg

The Bamboo Touch reports a sub-screen resolution of 480x320.
The signal-to-noise ratio is only about 100, so filtering is
needed in order to reduce the jitter to a usable level. However,
the low resolution leads to round-off errors in the EWMA filter,
resulting in extremely jerky pointer motion. This patch explicitly
sets a higher resolution for those devices, and tells this to
the completion handler via a low-resolution quirk.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/input/tablet/wacom_wac.c |   10 ++++++++++
 drivers/input/tablet/wacom_wac.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 97295aa..8193892 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -858,6 +858,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
 static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
 {
 	static int trkid;
+	struct wacom_features *features = &wacom->features;
 	struct input_dev *input = wacom->input;
 	unsigned char *data = wacom->data;
 	int sp = 0, sx = 0, sy = 0, count = 0;
@@ -872,6 +873,10 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
 		if (p) {
 			int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
 			int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
+			if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
+				x <<= 5;
+				y <<= 5;
+			}
 			input_report_abs(input, ABS_MT_PRESSURE, p);
 			input_report_abs(input, ABS_MT_POSITION_X, x);
 			input_report_abs(input, ABS_MT_POSITION_Y, y);
@@ -1010,8 +1015,13 @@ void wacom_setup_device_quirks(struct wacom_features *features)
 
 	/* quirks for bamboo touch */
 	if (features->type == BAMBOO_PT) {
+		features->x_max <<= 5;
+		features->y_max <<= 5;
+		features->x_fuzz <<= 5;
+		features->y_fuzz <<= 5;
 		features->pressure_max = 256;
 		features->pressure_fuzz = 16;
+		features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
 	}
 }
 
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 816ab0f..22cafe2 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -40,6 +40,7 @@
 
 /* device quirks */
 #define WACOM_QUIRK_MULTI_INPUT		0x0001
+#define WACOM_QUIRK_BBTOUCH_LOWRES	0x0002
 
 /* largest reported tracking id */
 #define MAX_TRACKING_ID			0xfff
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3)
  2010-09-04 13:42 [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Henrik Rydberg
                   ` (4 preceding siblings ...)
  2010-09-04 13:43 ` [PATCH 5/5] input: wacom: Add a quirk for lowres Bamboo devices (rev2) Henrik Rydberg
@ 2010-09-04 21:24 ` Ping Cheng
  2010-09-05 14:28   ` Chris Bagwell
  5 siblings, 1 reply; 10+ messages in thread
From: Ping Cheng @ 2010-09-04 21:24 UTC (permalink / raw)
  To: Henrik Rydberg
  Cc: Dmitry Torokhov, Ping Cheng, Chris Bagwell,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org

On Saturday, September 4, 2010, Henrik Rydberg <rydberg@euromail.se> wrote:
> This the fourth iteration of the Bamboo patches. Hopefully no big
> surprises.  The ordering has changed to allow setting the pressure_max
> which is not parsed in the hid function. Ping's button mapping has
> been implemented, relying on middle-button emulation instead.  The
> lowres quirks now apply to all touch devices in the family.

Thank you Henrik for the patchset. Very much appreciated.

Acked-by: Ping Cheng < pingc@wacom.com>  for the series.

Ping

> Henrik Rydberg (4):
>   input: wacom: Add fuzz parameters to features
>   input: wacom: Collect device quirks into single function (rev2)
>   input: wacom: Add support for the Bamboo Touch trackpad (rev4)
>   input: wacom: Add a quirk for lowres Bamboo devices (rev2)
>
> Ping Cheng (1):
>   input: wacom: Parse the Bamboo device family
>
>  drivers/input/tablet/wacom.h     |    1 +
>  drivers/input/tablet/wacom_sys.c |   57 +++++++++++++-----
>  drivers/input/tablet/wacom_wac.c |  123 +++++++++++++++++++++++++++++++++++++-
>  drivers/input/tablet/wacom_wac.h |   14 ++++
>  4 files changed, 176 insertions(+), 19 deletions(-)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/5] input: wacom: Add support for the Bamboo Touch trackpad (rev4)
  2010-09-04 13:43 ` [PATCH 4/5] input: wacom: Add support for the Bamboo Touch trackpad (rev4) Henrik Rydberg
@ 2010-09-05 10:04   ` Henrik Rydberg
  2010-09-05 20:03     ` Dmitry Torokhov
  0 siblings, 1 reply; 10+ messages in thread
From: Henrik Rydberg @ 2010-09-05 10:04 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Ping Cheng, Chris Bagwell, linux-input, linux-kernel

On 09/04/2010 03:43 PM, Henrik Rydberg wrote:

[...]

>@@ -955,6 +1007,12 @@ void wacom_setup_device_quirks(struct wacom
> 	if (features->type == TABLETPC || features->type == TABLETPC2FG ||
> 	    features->type == BAMBOO_PT)
> 		features->quirks |= WACOM_QUIRK_MULTI_INPUT;
>+
>+	/* quirks for bamboo touch */
>+	if (features->type == BAMBOO_PT) {

This line should have "&& features->device_type == BTN_TOOL_TRIPLETAP" appended
to it, to only target the touch device of Pen & Touch.

>+		features->pressure_max = 256;
>+		features->pressure_fuzz = 16;
>+	}
> }

Henrik

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3)
  2010-09-04 21:24 ` [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Ping Cheng
@ 2010-09-05 14:28   ` Chris Bagwell
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Bagwell @ 2010-09-05 14:28 UTC (permalink / raw)
  To: Ping Cheng
  Cc: Henrik Rydberg, Dmitry Torokhov, Ping Cheng,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org

On Sat, Sep 4, 2010 at 4:24 PM, Ping Cheng <pinglinux@gmail.com> wrote:
> On Saturday, September 4, 2010, Henrik Rydberg <rydberg@euromail.se> wrote:
>> This the fourth iteration of the Bamboo patches. Hopefully no big
>> surprises.  The ordering has changed to allow setting the pressure_max
>> which is not parsed in the hid function. Ping's button mapping has
>> been implemented, relying on middle-button emulation instead.  The
>> lowres quirks now apply to all touch devices in the family.
>
> Thank you Henrik for the patchset. Very much appreciated.
>
> Acked-by: Ping Cheng < pingc@wacom.com>  for the series.
>
> Ping

Thanks for addressing my comments/questions.

Also, Thanks for placing all the hooks for future pen support as well.
 I'll be following up with a patch set for that once your finished.
If there are any remaining pen specific issues, feel free to offload
it on me.

Chris

>
>> Henrik Rydberg (4):
>>   input: wacom: Add fuzz parameters to features
>>   input: wacom: Collect device quirks into single function (rev2)
>>   input: wacom: Add support for the Bamboo Touch trackpad (rev4)
>>   input: wacom: Add a quirk for lowres Bamboo devices (rev2)
>>
>> Ping Cheng (1):
>>   input: wacom: Parse the Bamboo device family
>>
>>  drivers/input/tablet/wacom.h     |    1 +
>>  drivers/input/tablet/wacom_sys.c |   57 +++++++++++++-----
>>  drivers/input/tablet/wacom_wac.c |  123 +++++++++++++++++++++++++++++++++++++-
>>  drivers/input/tablet/wacom_wac.h |   14 ++++
>>  4 files changed, 176 insertions(+), 19 deletions(-)
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-input" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/5] input: wacom: Add support for the Bamboo Touch trackpad (rev4)
  2010-09-05 10:04   ` Henrik Rydberg
@ 2010-09-05 20:03     ` Dmitry Torokhov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Torokhov @ 2010-09-05 20:03 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: Ping Cheng, Chris Bagwell, linux-input, linux-kernel

On Sun, Sep 05, 2010 at 12:04:00PM +0200, Henrik Rydberg wrote:
> On 09/04/2010 03:43 PM, Henrik Rydberg wrote:
> 
> [...]
> 
> >@@ -955,6 +1007,12 @@ void wacom_setup_device_quirks(struct wacom
> > 	if (features->type == TABLETPC || features->type == TABLETPC2FG ||
> > 	    features->type == BAMBOO_PT)
> > 		features->quirks |= WACOM_QUIRK_MULTI_INPUT;
> >+
> >+	/* quirks for bamboo touch */
> >+	if (features->type == BAMBOO_PT) {
> 
> This line should have "&& features->device_type == BTN_TOOL_TRIPLETAP" appended
> to it, to only target the touch device of Pen & Touch.
> 

Adjusted and applied all 5 patches. I also pulled trkid into wacom_wac
structure to make sure different instances of the device are independent
of each other.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-09-05 20:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-04 13:42 [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Henrik Rydberg
2010-09-04 13:42 ` [PATCH 1/5] input: wacom: Add fuzz parameters to features Henrik Rydberg
2010-09-04 13:43 ` [PATCH 2/5] input: wacom: Parse the Bamboo device family Henrik Rydberg
2010-09-04 13:43 ` [PATCH 3/5] input: wacom: Collect device quirks into single function (rev2) Henrik Rydberg
2010-09-04 13:43 ` [PATCH 4/5] input: wacom: Add support for the Bamboo Touch trackpad (rev4) Henrik Rydberg
2010-09-05 10:04   ` Henrik Rydberg
2010-09-05 20:03     ` Dmitry Torokhov
2010-09-04 13:43 ` [PATCH 5/5] input: wacom: Add a quirk for lowres Bamboo devices (rev2) Henrik Rydberg
2010-09-04 21:24 ` [PATCH 0/5] input: wacom: Initial support for Bamboo (rev3) Ping Cheng
2010-09-05 14:28   ` Chris Bagwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox