diff options
author | Przemo Firszt <przemo@firszt.eu> | 2012-05-04 13:00:10 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-05-07 09:03:03 -0400 |
commit | c653daba895a2d339b3b8f04e69fc111443ef327 (patch) | |
tree | 2d88f950868d629a02a80fbca2d2ec32d6bb5d39 /drivers/hid/hid-wacom.c | |
parent | 1fa2f722a70a6785fc3c2afd026a74b2684f32c7 (diff) |
HID: wacom: Add tilt reporting for Intuos4 WL
Tile is reported to input subsystem as reported by the device without
any modifications. It means that tilt X/Y range is 0 to 127 and it's
not centered on zero.
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-wacom.c')
-rw-r--r-- | drivers/hid/hid-wacom.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index fb0fe165a89d..a66e1aa25cac 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c | |||
@@ -363,6 +363,7 @@ static void wacom_i4_parse_pen_report(struct wacom_data *wdata, | |||
363 | { | 363 | { |
364 | __u16 x, y, pressure; | 364 | __u16 x, y, pressure; |
365 | __u8 distance; | 365 | __u8 distance; |
366 | __u8 tilt_x, tilt_y; | ||
366 | 367 | ||
367 | switch (data[1]) { | 368 | switch (data[1]) { |
368 | case 0x80: /* Out of proximity report */ | 369 | case 0x80: /* Out of proximity report */ |
@@ -399,6 +400,8 @@ static void wacom_i4_parse_pen_report(struct wacom_data *wdata, | |||
399 | pressure = (data[6] << 3) | ((data[7] & 0xC0) >> 5) | 400 | pressure = (data[6] << 3) | ((data[7] & 0xC0) >> 5) |
400 | | (data[1] & 0x01); | 401 | | (data[1] & 0x01); |
401 | distance = (data[9] >> 2) & 0x3f; | 402 | distance = (data[9] >> 2) & 0x3f; |
403 | tilt_x = ((data[7] << 1) & 0x7e) | (data[8] >> 7); | ||
404 | tilt_y = data[8] & 0x7f; | ||
402 | 405 | ||
403 | input_report_key(input, BTN_TOUCH, pressure > 1); | 406 | input_report_key(input, BTN_TOUCH, pressure > 1); |
404 | 407 | ||
@@ -409,6 +412,8 @@ static void wacom_i4_parse_pen_report(struct wacom_data *wdata, | |||
409 | input_report_abs(input, ABS_Y, y); | 412 | input_report_abs(input, ABS_Y, y); |
410 | input_report_abs(input, ABS_PRESSURE, pressure); | 413 | input_report_abs(input, ABS_PRESSURE, pressure); |
411 | input_report_abs(input, ABS_DISTANCE, distance); | 414 | input_report_abs(input, ABS_DISTANCE, distance); |
415 | input_report_abs(input, ABS_TILT_X, tilt_x); | ||
416 | input_report_abs(input, ABS_TILT_Y, tilt_y); | ||
412 | input_report_abs(input, ABS_MISC, wdata->id); | 417 | input_report_abs(input, ABS_MISC, wdata->id); |
413 | input_event(input, EV_MSC, MSC_SERIAL, wdata->serial); | 418 | input_event(input, EV_MSC, MSC_SERIAL, wdata->serial); |
414 | input_report_key(input, wdata->tool, 1); | 419 | input_report_key(input, wdata->tool, 1); |
@@ -548,6 +553,8 @@ static int wacom_input_mapped(struct hid_device *hdev, struct hid_input *hi, | |||
548 | input_set_abs_params(input, ABS_Y, 0, 25400, 4, 0); | 553 | input_set_abs_params(input, ABS_Y, 0, 25400, 4, 0); |
549 | input_set_abs_params(input, ABS_PRESSURE, 0, 2047, 0, 0); | 554 | input_set_abs_params(input, ABS_PRESSURE, 0, 2047, 0, 0); |
550 | input_set_abs_params(input, ABS_DISTANCE, 0, 63, 0, 0); | 555 | input_set_abs_params(input, ABS_DISTANCE, 0, 63, 0, 0); |
556 | input_set_abs_params(input, ABS_TILT_X, 0, 127, 0, 0); | ||
557 | input_set_abs_params(input, ABS_TILT_Y, 0, 127, 0, 0); | ||
551 | break; | 558 | break; |
552 | } | 559 | } |
553 | 560 | ||