Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291647
b: refs/heads/master
c: 2470900
h: refs/heads/master
i:
  291645: 2db93fe
  291643: 5ea5cb8
  291639: 566e648
  291631: a419d01
  291615: e96031c
  291583: 9390fb3
v: v3
  • Loading branch information
Przemo Firszt authored and Jiri Kosina committed Feb 27, 2012
1 parent f4aa996 commit 5b6ef36
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c653e6bac85918ae76ed0199f25fb6a2206b92d
refs/heads/master: 2470900b68ccfde046d5a20c47ae9abb4e406084
21 changes: 15 additions & 6 deletions trunk/drivers/hid/hid-wacom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 5b6ef36

Please sign in to comment.