diff options
author | Jason Gerecke <killertofu@gmail.com> | 2012-04-03 18:48:35 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-04-04 12:25:41 -0400 |
commit | f860e581fd473250c6dcbd3e13d576b6197e4694 (patch) | |
tree | cfaf897a9a454784029c64316ecd657361d884ff /drivers/input/tablet | |
parent | 9fee619505bdb202c9f54b58ec996884160cdbf2 (diff) |
Input: wacom - add Intuos5 Touch Ring/ExpressKey support
Intuos5 uses a new report type for Touch Ring and ExpressKey data.
Note that data from the capacitive sensors present on the ExpressKeys
will be ignored until a proper way is found to expose it.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 33 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.h | 1 |
2 files changed, 32 insertions, 2 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 20ab3645a117..f4a9efd393c9 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -484,7 +484,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
484 | int idx = 0, result; | 484 | int idx = 0, result; |
485 | 485 | ||
486 | if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD | 486 | if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD |
487 | && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) { | 487 | && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD |
488 | && data[0] != WACOM_REPORT_INTUOS5PAD) { | ||
488 | dbg("wacom_intuos_irq: received unknown report #%d", data[0]); | 489 | dbg("wacom_intuos_irq: received unknown report #%d", data[0]); |
489 | return 0; | 490 | return 0; |
490 | } | 491 | } |
@@ -494,7 +495,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
494 | idx = data[1] & 0x01; | 495 | idx = data[1] & 0x01; |
495 | 496 | ||
496 | /* pad packets. Works as a second tool and is always in prox */ | 497 | /* pad packets. Works as a second tool and is always in prox */ |
497 | if (data[0] == WACOM_REPORT_INTUOSPAD) { | 498 | if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) { |
498 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) { | 499 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) { |
499 | input_report_key(input, BTN_0, (data[2] & 0x01)); | 500 | input_report_key(input, BTN_0, (data[2] & 0x01)); |
500 | input_report_key(input, BTN_1, (data[3] & 0x01)); | 501 | input_report_key(input, BTN_1, (data[3] & 0x01)); |
@@ -570,6 +571,34 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
570 | input_report_key(input, wacom->tool[1], 0); | 571 | input_report_key(input, wacom->tool[1], 0); |
571 | input_report_abs(input, ABS_MISC, 0); | 572 | input_report_abs(input, ABS_MISC, 0); |
572 | } | 573 | } |
574 | } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) { | ||
575 | int i; | ||
576 | |||
577 | /* Touch ring mode switch has no capacitive sensor */ | ||
578 | input_report_key(input, BTN_0, (data[3] & 0x01)); | ||
579 | |||
580 | /* | ||
581 | * ExpressKeys on Intuos5 have a capacitive sensor in | ||
582 | * addition to the mechanical switch. Switch data is | ||
583 | * stored in data[4], capacitive data in data[5]. | ||
584 | */ | ||
585 | for (i = 0; i < 8; i++) | ||
586 | input_report_key(input, BTN_1 + i, data[4] & (1 << i)); | ||
587 | |||
588 | if (data[2] & 0x80) { | ||
589 | input_report_abs(input, ABS_WHEEL, (data[2] & 0x7f)); | ||
590 | } else { | ||
591 | /* Out of proximity, clear wheel value. */ | ||
592 | input_report_abs(input, ABS_WHEEL, 0); | ||
593 | } | ||
594 | |||
595 | if (data[2] | (data[3] & 0x01) | data[4]) { | ||
596 | input_report_key(input, wacom->tool[1], 1); | ||
597 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); | ||
598 | } else { | ||
599 | input_report_key(input, wacom->tool[1], 0); | ||
600 | input_report_abs(input, ABS_MISC, 0); | ||
601 | } | ||
573 | } else { | 602 | } else { |
574 | if (features->type == WACOM_21UX2) { | 603 | if (features->type == WACOM_21UX2) { |
575 | input_report_key(input, BTN_0, (data[5] & 0x01)); | 604 | input_report_key(input, BTN_0, (data[5] & 0x01)); |
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 0aa00ce5fd7d..17ba1868f0cd 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define WACOM_REPORT_INTUOSREAD 5 | 38 | #define WACOM_REPORT_INTUOSREAD 5 |
39 | #define WACOM_REPORT_INTUOSWRITE 6 | 39 | #define WACOM_REPORT_INTUOSWRITE 6 |
40 | #define WACOM_REPORT_INTUOSPAD 12 | 40 | #define WACOM_REPORT_INTUOSPAD 12 |
41 | #define WACOM_REPORT_INTUOS5PAD 3 | ||
41 | #define WACOM_REPORT_TPC1FG 6 | 42 | #define WACOM_REPORT_TPC1FG 6 |
42 | #define WACOM_REPORT_TPC2FG 13 | 43 | #define WACOM_REPORT_TPC2FG 13 |
43 | #define WACOM_REPORT_TPCHID 15 | 44 | #define WACOM_REPORT_TPCHID 15 |