aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c33
1 files changed, 31 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));