linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] HID: wacom: Add serial and id reporting for Wacom Intuos4 WL
@ 2012-02-24 13:52 Przemo Firszt
  2012-02-27 14:30 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Przemo Firszt @ 2012-02-24 13:52 UTC (permalink / raw)
  To: jkosina, pinglinux, chris
  Cc: linuxwacom-devel, linux-kernel, linux-input, Przemo Firszt

This patch implements reporting id and serial number of used tool.
Reported values are the same as for USB on of the driver for wacom Intuos4 WL

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
---
 drivers/hid/hid-wacom.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index a793753..49b9178 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -35,6 +35,8 @@ struct wacom_data {
 	__u16 tool;
 	unsigned char butstate;
 	__u8 features;
+	__u32 id;
+	__u32 serial;
 	unsigned char high_speed;
 #ifdef CONFIG_HID_WACOM_POWER_SUPPLY
 	int battery_capacity;
@@ -318,26 +320,30 @@ static void wacom_i4_parse_pen_report(struct wacom_data *wdata,
 			struct input_dev *input, unsigned char *data)
 {
 	__u16 x, y, pressure;
-	__u32 id;
 
 	switch (data[1]) {
 	case 0x80: /* Out of proximity report */
 		input_report_key(input, BTN_TOUCH, 0);
 		input_report_abs(input, ABS_PRESSURE, 0);
 		input_report_key(input, wdata->tool, 0);
+		input_report_abs(input, ABS_MISC, 0);
+		input_event(input, EV_MSC, MSC_SERIAL, wdata->serial);
 		wdata->tool = 0;
 		input_sync(input);
 		break;
 	case 0xC2: /* Tool report */
-		id = ((data[2] << 4) | (data[3] >> 4) |
+		wdata->id = ((data[2] << 4) | (data[3] >> 4) |
 			((data[7] & 0x0f) << 20) |
-			((data[8] & 0xf0) << 12)) & 0xfffff;
+			((data[8] & 0xf0) << 12));
+		wdata->serial = ((data[3] & 0x0f) << 28) +
+				(data[4] << 20) + (data[5] << 12) +
+				(data[6] << 4) + (data[7] >> 4);
 
-		switch (id) {
-		case 0x802:
+		switch (wdata->id) {
+		case 0x100802:
 			wdata->tool = BTN_TOOL_PEN;
 			break;
-		case 0x80A:
+		case 0x10080A:
 			wdata->tool = BTN_TOOL_RUBBER;
 			break;
 		}
@@ -356,6 +362,9 @@ static void wacom_i4_parse_pen_report(struct wacom_data *wdata,
 		input_report_abs(input, ABS_X, x);
 		input_report_abs(input, ABS_Y, y);
 		input_report_abs(input, ABS_PRESSURE, pressure);
+		input_report_abs(input, ABS_MISC, wdata->id);
+		input_event(input, EV_MSC, MSC_SERIAL, wdata->serial);
+		input_report_key(input, wdata->tool, 1);
 		input_sync(input);
 		break;
 	}
-- 
1.7.6.4


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

* Re: [PATCH 2/2] HID: wacom: Add serial and id reporting for Wacom Intuos4 WL
  2012-02-24 13:52 [PATCH 2/2] HID: wacom: Add serial and id reporting for Wacom Intuos4 WL Przemo Firszt
@ 2012-02-27 14:30 ` Jiri Kosina
  2012-02-27 14:44   ` Przemo Firszt
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2012-02-27 14:30 UTC (permalink / raw)
  To: Przemo Firszt
  Cc: pinglinux, chris, linuxwacom-devel, linux-kernel, linux-input

On Fri, 24 Feb 2012, Przemo Firszt wrote:

> This patch implements reporting id and serial number of used tool.
> Reported values are the same as for USB on of the driver for wacom Intuos4 W

Applied.

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH 2/2] HID: wacom: Add serial and id reporting for Wacom Intuos4 WL
  2012-02-27 14:30 ` Jiri Kosina
@ 2012-02-27 14:44   ` Przemo Firszt
  0 siblings, 0 replies; 3+ messages in thread
From: Przemo Firszt @ 2012-02-27 14:44 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: pinglinux, chris, linuxwacom-devel, linux-kernel, linux-input

Dnia 2012-02-27, pon o godzinie 15:30 +0100, Jiri Kosina pisze:
> On Fri, 24 Feb 2012, Przemo Firszt wrote:
> 
> > This patch implements reporting id and serial number of used tool.
> > Reported values are the same as for USB on of the driver for wacom Intuos4 W
> 
> Applied.
> 

Thanks!
-- 
Przemo


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

end of thread, other threads:[~2012-02-27 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-24 13:52 [PATCH 2/2] HID: wacom: Add serial and id reporting for Wacom Intuos4 WL Przemo Firszt
2012-02-27 14:30 ` Jiri Kosina
2012-02-27 14:44   ` Przemo Firszt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).