All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support
@ 2010-11-29  7:43 Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 1/7] hid: egalax: Use kzalloc Henrik Rydberg
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29  7:43 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel, Henrik Rydberg

Hi Jiri,

This is the second version of this patchset, extended to also support
the Wetab. The input core changes aside, the patches provide exactly
the same changes, except for a better signal-to-noise value provided
by Phillip.

The first patch is already in your tree, but provided for completeness
(the present set is against -rc3). The second patch no longer sets up
the events per packet, since it is handled during slots
initialization. The third and fourth patch are identical, the fifth
has that new value, and the sixth is further simplified by using the
new input core interface. The seventh patch adds support for the
Wetab.

The driver has been tested succesfully on all three supported device
ids.

Cheers,
Henrik

Henrik Rydberg (7):
  hid: egalax: Use kzalloc
  hid: egalax: Setup input device manually (rev2)
  hid: egalax: Correct for device resolution report error (rev2)
  hid: egalax: Report zero as minimum pressure (rev2)
  hid: egalax: Add event filtering (rev3)
  hid: egalax: Convert to MT slots (rev2)
  hid: egalax: Add support for Wetab

 drivers/hid/hid-core.c   |    1 +
 drivers/hid/hid-egalax.c |  129 +++++++++++++++++++---------------------------
 drivers/hid/hid-ids.h    |    1 +
 3 files changed, 56 insertions(+), 75 deletions(-)


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

* [PATCH 1/7] hid: egalax: Use kzalloc
  2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
@ 2010-11-29  7:43 ` Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 2/7] hid: egalax: Setup input device manually (rev2) Henrik Rydberg
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29  7:43 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel, Henrik Rydberg

To avoid unnecessary explicit initialization, allocate zeroed memory.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/hid-egalax.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c
index 54b017a..5a1b52e 100644
--- a/drivers/hid/hid-egalax.c
+++ b/drivers/hid/hid-egalax.c
@@ -221,7 +221,7 @@ static int egalax_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	struct egalax_data *td;
 	struct hid_report *report;
 
-	td = kmalloc(sizeof(struct egalax_data), GFP_KERNEL);
+	td = kzalloc(sizeof(struct egalax_data), GFP_KERNEL);
 	if (!td) {
 		dev_err(&hdev->dev, "cannot allocate eGalax data\n");
 		return -ENOMEM;
-- 
1.7.1


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

* [PATCH 2/7] hid: egalax: Setup input device manually (rev2)
  2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 1/7] hid: egalax: Use kzalloc Henrik Rydberg
@ 2010-11-29  7:43 ` Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 3/7] hid: egalax: Correct for device resolution report error (rev2) Henrik Rydberg
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29  7:43 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel, Henrik Rydberg

The hid core does not yet handle input filtering. Take over the setup
of the input device, so that proper signal-to-noise ratios can be
used.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/hid-egalax.c |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c
index 5a1b52e..6fbb4e0 100644
--- a/drivers/hid/hid-egalax.c
+++ b/drivers/hid/hid-egalax.c
@@ -34,10 +34,21 @@ struct egalax_data {
 	__u16 lastx, lasty, lastz;	/* latest valid (x, y, z) in the frame */
 };
 
+static void set_abs(struct input_dev *input, unsigned int code,
+		    struct hid_field *field, int snratio)
+{
+	int fmin = field->logical_minimum;
+	int fmax = field->logical_maximum;
+	int fuzz = snratio ? (fmax - fmin) / snratio : 0;
+	input_set_abs_params(input, code, fmin, fmax, fuzz, 0);
+}
+
 static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		struct hid_field *field, struct hid_usage *usage,
 		unsigned long **bit, int *max)
 {
+	struct input_dev *input = hi->input;
+
 	switch (usage->hid & HID_USAGE_PAGE) {
 
 	case HID_UP_GENDESK:
@@ -45,18 +56,16 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		case HID_GD_X:
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_POSITION_X);
+			set_abs(input, ABS_MT_POSITION_X, field, 0);
 			/* touchscreen emulation */
-			input_set_abs_params(hi->input, ABS_X,
-						field->logical_minimum,
-						field->logical_maximum, 0, 0);
+			set_abs(input, ABS_X, field, 0);
 			return 1;
 		case HID_GD_Y:
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_POSITION_Y);
+			set_abs(input, ABS_MT_POSITION_Y, field, 0);
 			/* touchscreen emulation */
-			input_set_abs_params(hi->input, ABS_Y,
-						field->logical_minimum,
-						field->logical_maximum, 0, 0);
+			set_abs(input, ABS_Y, field, 0);
 			return 1;
 		}
 		return 0;
@@ -66,6 +75,7 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		case HID_DG_TIPSWITCH:
 			/* touchscreen emulation */
 			hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
+			input_set_capability(input, EV_KEY, BTN_TOUCH);
 			return 1;
 		case HID_DG_INRANGE:
 		case HID_DG_CONFIDENCE:
@@ -75,14 +85,14 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		case HID_DG_CONTACTID:
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_TRACKING_ID);
+			set_abs(input, ABS_MT_TRACKING_ID, field, 0);
 			return 1;
 		case HID_DG_TIPPRESSURE:
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_PRESSURE);
+			set_abs(input, ABS_MT_PRESSURE, field, 0);
 			/* touchscreen emulation */
-			input_set_abs_params(hi->input, ABS_PRESSURE,
-						field->logical_minimum,
-						field->logical_maximum, 0, 0);
+			set_abs(input, ABS_PRESSURE, field, 0);
 			return 1;
 		}
 		return 0;
@@ -96,10 +106,10 @@ static int egalax_input_mapped(struct hid_device *hdev, struct hid_input *hi,
 		struct hid_field *field, struct hid_usage *usage,
 		unsigned long **bit, int *max)
 {
+	/* tell hid-input to skip setup of these event types */
 	if (usage->type == EV_KEY || usage->type == EV_ABS)
-		clear_bit(usage->code, *bit);
-
-	return 0;
+		set_bit(usage->type, hi->input->evbit);
+	return -1;
 }
 
 /*
-- 
1.7.1


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

* [PATCH 3/7] hid: egalax: Correct for device resolution report error (rev2)
  2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 1/7] hid: egalax: Use kzalloc Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 2/7] hid: egalax: Setup input device manually (rev2) Henrik Rydberg
@ 2010-11-29  7:43 ` Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 4/7] hid: egalax: Report zero as minimum pressure (rev2) Henrik Rydberg
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29  7:43 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel, Henrik Rydberg

The firmware of both supported devices report a X/Y maximum of 4095,
whereas in reality, it is eight times larger. Fixed with this patch.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/hid-egalax.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c
index 6fbb4e0..b3a1139 100644
--- a/drivers/hid/hid-egalax.c
+++ b/drivers/hid/hid-egalax.c
@@ -54,6 +54,7 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 	case HID_UP_GENDESK:
 		switch (usage->hid) {
 		case HID_GD_X:
+			field->logical_maximum = 32760;
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_POSITION_X);
 			set_abs(input, ABS_MT_POSITION_X, field, 0);
@@ -61,6 +62,7 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			set_abs(input, ABS_X, field, 0);
 			return 1;
 		case HID_GD_Y:
+			field->logical_maximum = 32760;
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_POSITION_Y);
 			set_abs(input, ABS_MT_POSITION_Y, field, 0);
-- 
1.7.1


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

* [PATCH 4/7] hid: egalax: Report zero as minimum pressure (rev2)
  2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
                   ` (2 preceding siblings ...)
  2010-11-29  7:43 ` [PATCH 3/7] hid: egalax: Correct for device resolution report error (rev2) Henrik Rydberg
@ 2010-11-29  7:43 ` Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 5/7] hid: egalax: Add event filtering (rev3) Henrik Rydberg
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29  7:43 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel, Henrik Rydberg

The firmware reports a logical minimum of one, but in order for
userspace applications to correctly map all reported values to
non-zero pressure, the driver needs to report a logical minimum of
zero.  Fixed with this patch.

Tested-by: Philipp Merkel <mail@philmerk.de>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/hid-egalax.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c
index b3a1139..a6ab617 100644
--- a/drivers/hid/hid-egalax.c
+++ b/drivers/hid/hid-egalax.c
@@ -90,6 +90,7 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			set_abs(input, ABS_MT_TRACKING_ID, field, 0);
 			return 1;
 		case HID_DG_TIPPRESSURE:
+			field->logical_minimum = 0;
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_PRESSURE);
 			set_abs(input, ABS_MT_PRESSURE, field, 0);
-- 
1.7.1


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

* [PATCH 5/7] hid: egalax: Add event filtering (rev3)
  2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
                   ` (3 preceding siblings ...)
  2010-11-29  7:43 ` [PATCH 4/7] hid: egalax: Report zero as minimum pressure (rev2) Henrik Rydberg
@ 2010-11-29  7:43 ` Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 6/7] hid: egalax: Convert to MT slots (rev2) Henrik Rydberg
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29  7:43 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel, Henrik Rydberg

Use estimated signal-to-noise ratios to reduce noise and limit the
amount of events emitted.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/hid-egalax.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c
index a6ab617..5da5ecb 100644
--- a/drivers/hid/hid-egalax.c
+++ b/drivers/hid/hid-egalax.c
@@ -25,6 +25,10 @@ MODULE_LICENSE("GPL");
 
 #include "hid-ids.h"
 
+/* estimated signal-to-noise ratios */
+#define SN_MOVE			4096
+#define SN_PRESSURE		32
+
 struct egalax_data {
 	__u16 x, y, z;
 	__u8 id;
@@ -57,17 +61,17 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			field->logical_maximum = 32760;
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_POSITION_X);
-			set_abs(input, ABS_MT_POSITION_X, field, 0);
+			set_abs(input, ABS_MT_POSITION_X, field, SN_MOVE);
 			/* touchscreen emulation */
-			set_abs(input, ABS_X, field, 0);
+			set_abs(input, ABS_X, field, SN_MOVE);
 			return 1;
 		case HID_GD_Y:
 			field->logical_maximum = 32760;
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_POSITION_Y);
-			set_abs(input, ABS_MT_POSITION_Y, field, 0);
+			set_abs(input, ABS_MT_POSITION_Y, field, SN_MOVE);
 			/* touchscreen emulation */
-			set_abs(input, ABS_Y, field, 0);
+			set_abs(input, ABS_Y, field, SN_MOVE);
 			return 1;
 		}
 		return 0;
@@ -93,9 +97,9 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			field->logical_minimum = 0;
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_PRESSURE);
-			set_abs(input, ABS_MT_PRESSURE, field, 0);
+			set_abs(input, ABS_MT_PRESSURE, field, SN_PRESSURE);
 			/* touchscreen emulation */
-			set_abs(input, ABS_PRESSURE, field, 0);
+			set_abs(input, ABS_PRESSURE, field, SN_PRESSURE);
 			return 1;
 		}
 		return 0;
-- 
1.7.1


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

* [PATCH 6/7] hid: egalax: Convert to MT slots (rev2)
  2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
                   ` (4 preceding siblings ...)
  2010-11-29  7:43 ` [PATCH 5/7] hid: egalax: Add event filtering (rev3) Henrik Rydberg
@ 2010-11-29  7:43 ` Henrik Rydberg
  2010-11-29  7:43 ` [PATCH 7/7] hid: egalax: Add support for Wetab Henrik Rydberg
  2010-11-29 11:50 ` [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Jiri Kosina
  7 siblings, 0 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29  7:43 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel, Henrik Rydberg

The firmware in the joojoo reports touches sequentially, one per
report, which confuses the current driver. A further complication
is the absense of any indication of a touch frame. This patch converts
the driver to the MT slots protocol, and outputs one full touch frame
per report. This way, proper handling for both firmwares is ensured.

Tested-by: Philipp Merkel <mail@philmerk.de>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/hid-egalax.c |   86 ++++++++++++---------------------------------
 1 files changed, 23 insertions(+), 63 deletions(-)

diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c
index 5da5ecb..e36dbd4 100644
--- a/drivers/hid/hid-egalax.c
+++ b/drivers/hid/hid-egalax.c
@@ -2,6 +2,8 @@
  *  HID driver for eGalax dual-touch panels
  *
  *  Copyright (c) 2010 Stephane Chatty <chatty@enac.fr>
+ *  Copyright (c) 2010 Henrik Rydberg <rydberg@euromail.se>
+ *  Copyright (c) 2010 Canonical, Ltd.
  *
  */
 
@@ -16,6 +18,7 @@
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/usb.h>
+#include <linux/input-mt.h>
 #include <linux/slab.h>
 #include "usbhid/usbhid.h"
 
@@ -25,17 +28,17 @@ MODULE_LICENSE("GPL");
 
 #include "hid-ids.h"
 
+#define MAX_SLOTS		2
+
 /* estimated signal-to-noise ratios */
 #define SN_MOVE			4096
 #define SN_PRESSURE		32
 
 struct egalax_data {
-	__u16 x, y, z;
-	__u8 id;
-	bool first;		/* is this the first finger in the frame? */
-	bool valid;		/* valid finger data, or just placeholder? */
-	bool activity;		/* at least one active finger previously? */
-	__u16 lastx, lasty, lastz;	/* latest valid (x, y, z) in the frame */
+	int valid;
+	int slot;
+	int touch;
+	int x, y, z;
 };
 
 static void set_abs(struct input_dev *input, unsigned int code,
@@ -89,9 +92,7 @@ static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		case HID_DG_CONTACTMAX:
 			return -1;
 		case HID_DG_CONTACTID:
-			hid_map_usage(hi, usage, bit, max,
-					EV_ABS, ABS_MT_TRACKING_ID);
-			set_abs(input, ABS_MT_TRACKING_ID, field, 0);
+			input_mt_init_slots(input, MAX_SLOTS);
 			return 1;
 		case HID_DG_TIPPRESSURE:
 			field->logical_minimum = 0;
@@ -125,58 +126,16 @@ static int egalax_input_mapped(struct hid_device *hdev, struct hid_input *hi,
  */
 static void egalax_filter_event(struct egalax_data *td, struct input_dev *input)
 {
-	td->first = !td->first; /* touchscreen emulation */
-
-	if (td->valid) {
-		/* emit multitouch events */
-		input_event(input, EV_ABS, ABS_MT_TRACKING_ID, td->id);
-		input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x >> 3);
-		input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y >> 3);
+	input_mt_slot(input, td->slot);
+	input_mt_report_slot_state(input, td->touch);
+	if (td->touch) {
+		input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x);
+		input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y);
 		input_event(input, EV_ABS, ABS_MT_PRESSURE, td->z);
-
-		input_mt_sync(input);
-
-		/*
-		 * touchscreen emulation: store (x, y) as
-		 * the last valid values in this frame
-		 */
-		td->lastx = td->x;
-		td->lasty = td->y;
-		td->lastz = td->z;
-	}
-
-	/*
-	 * touchscreen emulation: if this is the second finger and at least
-	 * one in this frame is valid, the latest valid in the frame is
-	 * the oldest on the panel, the one we want for single touch
-	 */
-	if (!td->first && td->activity) {
-		input_event(input, EV_ABS, ABS_X, td->lastx >> 3);
-		input_event(input, EV_ABS, ABS_Y, td->lasty >> 3);
- 		input_event(input, EV_ABS, ABS_PRESSURE, td->lastz);
-	}
-
-	if (!td->valid) {
-		/*
-		 * touchscreen emulation: if the first finger is invalid
-		 * and there previously was finger activity, this is a release
-		 */ 
-		if (td->first && td->activity) {
-			input_event(input, EV_KEY, BTN_TOUCH, 0);
-			td->activity = false;
-		}
-		return;
-	}
-
-
-	/* touchscreen emulation: if no previous activity, emit touch event */
-	if (!td->activity) {
-		input_event(input, EV_KEY, BTN_TOUCH, 1);
-		td->activity = true;
 	}
+	input_mt_report_pointer_emulation(input);
 }
 
-
 static int egalax_event(struct hid_device *hid, struct hid_field *field,
 				struct hid_usage *usage, __s32 value)
 {
@@ -186,25 +145,26 @@ static int egalax_event(struct hid_device *hid, struct hid_field *field,
 	 * uses a standard parallel multitouch protocol (product ID ==
 	 * 48xx).  The second is capacitive and uses an unusual "serial"
 	 * protocol with a different message for each multitouch finger
-	 * (product ID == 72xx).  We do not yet generate a correct event
-	 * sequence for the capacitive/serial protocol.
+	 * (product ID == 72xx).
 	 */
 	if (hid->claimed & HID_CLAIMED_INPUT) {
 		struct input_dev *input = field->hidinput->input;
 
 		switch (usage->hid) {
 		case HID_DG_INRANGE:
+			td->valid = value;
+			break;
 		case HID_DG_CONFIDENCE:
 			/* avoid interference from generic hidinput handling */
 			break;
 		case HID_DG_TIPSWITCH:
-			td->valid = value;
+			td->touch = value;
 			break;
 		case HID_DG_TIPPRESSURE:
 			td->z = value;
 			break;
 		case HID_DG_CONTACTID:
-			td->id = value;
+			td->slot = clamp_val(value, 0, MAX_SLOTS - 1);
 			break;
 		case HID_GD_X:
 			td->x = value;
@@ -212,11 +172,11 @@ static int egalax_event(struct hid_device *hid, struct hid_field *field,
 		case HID_GD_Y:
 			td->y = value;
 			/* this is the last field in a finger */
-			egalax_filter_event(td, input);
+			if (td->valid)
+				egalax_filter_event(td, input);
 			break;
 		case HID_DG_CONTACTCOUNT:
 			/* touch emulation: this is the last field in a frame */
-			td->first = false;
 			break;
 
 		default:
-- 
1.7.1


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

* [PATCH 7/7] hid: egalax: Add support for Wetab
  2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
                   ` (5 preceding siblings ...)
  2010-11-29  7:43 ` [PATCH 6/7] hid: egalax: Convert to MT slots (rev2) Henrik Rydberg
@ 2010-11-29  7:43 ` Henrik Rydberg
  2010-11-29 11:50 ` [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Jiri Kosina
  7 siblings, 0 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29  7:43 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel, Henrik Rydberg

The Wetab tablet dual-touch controller works the same way as the
one in the Joojoo tablet. This patch adds the Wetab to the list
of supported devices, and grabs it accordingly in hid-core.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/hid-core.c   |    1 +
 drivers/hid/hid-egalax.c |    2 ++
 drivers/hid/hid-ids.h    |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 515345b..9762de5 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1300,6 +1300,7 @@ static const struct hid_device_id hid_blacklist[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c
index e36dbd4..1f2ad7d 100644
--- a/drivers/hid/hid-egalax.c
+++ b/drivers/hid/hid-egalax.c
@@ -238,6 +238,8 @@ static const struct hid_device_id egalax_devices[] = {
 			USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV,
 			USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV,
+			USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2) },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, egalax_devices);
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 3341baa..b76166a 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -196,6 +196,7 @@
 #define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER	0x0001
 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH	0x480d
 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1	0x720c
+#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2	0x72a1
 
 #define USB_VENDOR_ID_ELECOM		0x056e
 #define USB_DEVICE_ID_ELECOM_BM084	0x0061
-- 
1.7.1


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

* Re: [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support
  2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
                   ` (6 preceding siblings ...)
  2010-11-29  7:43 ` [PATCH 7/7] hid: egalax: Add support for Wetab Henrik Rydberg
@ 2010-11-29 11:50 ` Jiri Kosina
  2010-11-29 13:41   ` Henrik Rydberg
  2010-11-30  9:08   ` Dmitry Torokhov
  7 siblings, 2 replies; 14+ messages in thread
From: Jiri Kosina @ 2010-11-29 11:50 UTC (permalink / raw)
  To: Henrik Rydberg
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel

On Mon, 29 Nov 2010, Henrik Rydberg wrote:

> Hi Jiri,
> 
> This is the second version of this patchset, extended to also support
> the Wetab. The input core changes aside, the patches provide exactly
> the same changes, except for a better signal-to-noise value provided
> by Phillip.
> 
> The first patch is already in your tree, but provided for completeness
> (the present set is against -rc3). The second patch no longer sets up
> the events per packet, since it is handled during slots
> initialization. The third and fourth patch are identical, the fifth
> has that new value, and the sixth is further simplified by using the
> new input core interface. The seventh patch adds support for the
> Wetab.
> 
> The driver has been tested succesfully on all three supported device
> ids.
> 
> Cheers,
> Henrik
> 
> Henrik Rydberg (7):
>   hid: egalax: Use kzalloc
>   hid: egalax: Setup input device manually (rev2)
>   hid: egalax: Correct for device resolution report error (rev2)
>   hid: egalax: Report zero as minimum pressure (rev2)
>   hid: egalax: Add event filtering (rev3)
>   hid: egalax: Convert to MT slots (rev2)
>   hid: egalax: Add support for Wetab
> 
>  drivers/hid/hid-core.c   |    1 +
>  drivers/hid/hid-egalax.c |  129 +++++++++++++++++++---------------------------
>  drivers/hid/hid-ids.h    |    1 +
>  3 files changed, 56 insertions(+), 75 deletions(-)

>From a quick look, it looks basically fine to me, thanks!

Just a very minor nit: it'd be nice to have the Kconfig help text entry 
updated, as the eGalax driver now supports more than what is described 
there.

How are we going to handle this? Dmitry, what is your plan with input-mt 
slots changes?

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

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

* Re: [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support
  2010-11-29 11:50 ` [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Jiri Kosina
@ 2010-11-29 13:41   ` Henrik Rydberg
  2010-11-30 16:58     ` Jiri Kosina
  2010-11-30  9:08   ` Dmitry Torokhov
  1 sibling, 1 reply; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-29 13:41 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel

On 11/29/2010 12:50 PM, Jiri Kosina wrote:

> On Mon, 29 Nov 2010, Henrik Rydberg wrote:
> 
>> Hi Jiri,
>>
>> This is the second version of this patchset, extended to also support
>> the Wetab. The input core changes aside, the patches provide exactly
>> the same changes, except for a better signal-to-noise value provided
>> by Phillip.
>>
>> The first patch is already in your tree, but provided for completeness
>> (the present set is against -rc3). The second patch no longer sets up
>> the events per packet, since it is handled during slots
>> initialization. The third and fourth patch are identical, the fifth
>> has that new value, and the sixth is further simplified by using the
>> new input core interface. The seventh patch adds support for the
>> Wetab.
>>
>> The driver has been tested succesfully on all three supported device
>> ids.
>>
>> Cheers,
>> Henrik
>>
>> Henrik Rydberg (7):
>>   hid: egalax: Use kzalloc
>>   hid: egalax: Setup input device manually (rev2)
>>   hid: egalax: Correct for device resolution report error (rev2)
>>   hid: egalax: Report zero as minimum pressure (rev2)
>>   hid: egalax: Add event filtering (rev3)
>>   hid: egalax: Convert to MT slots (rev2)
>>   hid: egalax: Add support for Wetab
>>
>>  drivers/hid/hid-core.c   |    1 +
>>  drivers/hid/hid-egalax.c |  129 +++++++++++++++++++---------------------------
>>  drivers/hid/hid-ids.h    |    1 +
>>  3 files changed, 56 insertions(+), 75 deletions(-)
> 
> From a quick look, it looks basically fine to me, thanks!
> 
> Just a very minor nit: it'd be nice to have the Kconfig help text entry 
> updated, as the eGalax driver now supports more than what is described 
> there.


Something like this, perhaps?

>From c6675000b59412b22f4f798de4268318e39b628c Mon Sep 17 00:00:00 2001
From: Henrik Rydberg <rydberg@euromail.se>
Date: Mon, 29 Nov 2010 14:40:11 +0100
Subject: [PATCH] hid: egalax: Document the newly supported models in Kconfig

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/Kconfig |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 3052e29..401acec 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -154,7 +154,8 @@ config HID_EGALAX
 	tristate "eGalax multi-touch panel"
 	depends on USB_HID
 	---help---
-	Support for the eGalax dual-touch panel.
+	Support for the eGalax dual-touch panels, including the
+	Joojoo and Wetab tablets.

 config HID_ELECOM

Thanks,
Henrik

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

* Re: [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support
  2010-11-29 11:50 ` [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Jiri Kosina
  2010-11-29 13:41   ` Henrik Rydberg
@ 2010-11-30  9:08   ` Dmitry Torokhov
  2010-11-30  9:51     ` Henrik Rydberg
  2010-11-30 14:24     ` Jiri Kosina
  1 sibling, 2 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2010-11-30  9:08 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Henrik Rydberg, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel

On Mon, Nov 29, 2010 at 12:50:05PM +0100, Jiri Kosina wrote:
> 
> How are we going to handle this? Dmitry, what is your plan with input-mt 
> slots changes?
> 

Hmm, I could create a branch for MT work and you could pull from it...

Henrik, have you set up your tree yet?

-- 
Dmitry

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

* Re: [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support
  2010-11-30  9:08   ` Dmitry Torokhov
@ 2010-11-30  9:51     ` Henrik Rydberg
  2010-11-30 14:24     ` Jiri Kosina
  1 sibling, 0 replies; 14+ messages in thread
From: Henrik Rydberg @ 2010-11-30  9:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Jiri Kosina, Philipp Merkel, Stephane Chatty, linux-input, linux-kernel

On 11/30/2010 10:08 AM, Dmitry Torokhov wrote:

> On Mon, Nov 29, 2010 at 12:50:05PM +0100, Jiri Kosina wrote:
>>
>> How are we going to handle this? Dmitry, what is your plan with input-mt 
>> slots changes?
>>
> 
> Hmm, I could create a branch for MT work and you could pull from it...
> 
> Henrik, have you set up your tree yet?

Nope, no account yet, unfortunately.

Henrik


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

* Re: [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support
  2010-11-30  9:08   ` Dmitry Torokhov
  2010-11-30  9:51     ` Henrik Rydberg
@ 2010-11-30 14:24     ` Jiri Kosina
  1 sibling, 0 replies; 14+ messages in thread
From: Jiri Kosina @ 2010-11-30 14:24 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Henrik Rydberg, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel

On Tue, 30 Nov 2010, Dmitry Torokhov wrote:

> > How are we going to handle this? Dmitry, what is your plan with input-mt 
> > slots changes?
> 
> Hmm, I could create a branch for MT work and you could pull from it...

That would work nicely for me, thanks.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

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

* Re: [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support
  2010-11-29 13:41   ` Henrik Rydberg
@ 2010-11-30 16:58     ` Jiri Kosina
  0 siblings, 0 replies; 14+ messages in thread
From: Jiri Kosina @ 2010-11-30 16:58 UTC (permalink / raw)
  To: Henrik Rydberg
  Cc: Dmitry Torokhov, Philipp Merkel, Stephane Chatty, linux-input,
	linux-kernel

On Mon, 29 Nov 2010, Henrik Rydberg wrote:

> Something like this, perhaps?
> 
> >From c6675000b59412b22f4f798de4268318e39b628c Mon Sep 17 00:00:00 2001
> From: Henrik Rydberg <rydberg@euromail.se>
> Date: Mon, 29 Nov 2010 14:40:11 +0100
> Subject: [PATCH] hid: egalax: Document the newly supported models in Kconfig
> 
> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
> ---
>  drivers/hid/Kconfig |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 3052e29..401acec 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -154,7 +154,8 @@ config HID_EGALAX
>  	tristate "eGalax multi-touch panel"
>  	depends on USB_HID
>  	---help---
> -	Support for the eGalax dual-touch panel.
> +	Support for the eGalax dual-touch panels, including the
> +	Joojoo and Wetab tablets.

Yes, that would be sufficient. Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

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

end of thread, other threads:[~2010-11-30 16:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-29  7:43 [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Henrik Rydberg
2010-11-29  7:43 ` [PATCH 1/7] hid: egalax: Use kzalloc Henrik Rydberg
2010-11-29  7:43 ` [PATCH 2/7] hid: egalax: Setup input device manually (rev2) Henrik Rydberg
2010-11-29  7:43 ` [PATCH 3/7] hid: egalax: Correct for device resolution report error (rev2) Henrik Rydberg
2010-11-29  7:43 ` [PATCH 4/7] hid: egalax: Report zero as minimum pressure (rev2) Henrik Rydberg
2010-11-29  7:43 ` [PATCH 5/7] hid: egalax: Add event filtering (rev3) Henrik Rydberg
2010-11-29  7:43 ` [PATCH 6/7] hid: egalax: Convert to MT slots (rev2) Henrik Rydberg
2010-11-29  7:43 ` [PATCH 7/7] hid: egalax: Add support for Wetab Henrik Rydberg
2010-11-29 11:50 ` [PATCH 0/7] hid: egalax: Rework to include Joojoo and Wetab support Jiri Kosina
2010-11-29 13:41   ` Henrik Rydberg
2010-11-30 16:58     ` Jiri Kosina
2010-11-30  9:08   ` Dmitry Torokhov
2010-11-30  9:51     ` Henrik Rydberg
2010-11-30 14:24     ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.