From 5b6ef36364c73d1a3d140425554bc3290e03518d Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Fri, 24 Feb 2012 13:52:32 +0000 Subject: [PATCH] --- yaml --- r: 291647 b: refs/heads/master c: 2470900b68ccfde046d5a20c47ae9abb4e406084 h: refs/heads/master i: 291645: 2db93fe8f91437e55e9554651329c547edbf61d6 291643: 5ea5cb8332cc4e4577bd9c5644dc382b20c777cd 291639: 566e6486a70ca9a6f78e44e2ac3d9da1fc3a94e2 291631: a419d01af1eb708ccd12f9a67e93e0d27fd26561 291615: e96031cf0b6ed202dbc072d07b1d36da778b4ecb 291583: 9390fb303b48a7332263115783095442eec30c11 v: v3 --- [refs] | 2 +- trunk/drivers/hid/hid-wacom.c | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 6b7687d466fc..fc37f40d6c67 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2c653e6bac85918ae76ed0199f25fb6a2206b92d +refs/heads/master: 2470900b68ccfde046d5a20c47ae9abb4e406084 diff --git a/trunk/drivers/hid/hid-wacom.c b/trunk/drivers/hid/hid-wacom.c index c4a193b6c44e..a3476f9a5103 100644 --- a/trunk/drivers/hid/hid-wacom.c +++ b/trunk/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; }