diff options
author | Ping Cheng <pinglinux@gmail.com> | 2013-05-15 02:34:53 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-05-23 12:01:28 -0400 |
commit | c73a1afbe6dce11b6e249d0eee69b90dc24daa88 (patch) | |
tree | 617d315d1656a06c7f5cfbe4da611443b310d14b /drivers/input/tablet | |
parent | f0aaceac279477f2a830e2897e6fc4c3500fc683 (diff) |
Input: wacom - add an eraser to DTH2242/DTK2241
plus send begin and end of express keys events for
Cintiq 13HD and DTH2242/DTK2241
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 3b6998a27a3f..5c68e4486845 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -362,7 +362,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
362 | case 0x100804: /* Intuos4/5 13HD/24HD Art Pen */ | 362 | case 0x100804: /* Intuos4/5 13HD/24HD Art Pen */ |
363 | case 0x140802: /* Intuos4/5 13HD/24HD Classic Pen */ | 363 | case 0x140802: /* Intuos4/5 13HD/24HD Classic Pen */ |
364 | case 0x160802: /* Cintiq 13HD Pro Pen */ | 364 | case 0x160802: /* Cintiq 13HD Pro Pen */ |
365 | case 0x180802: /* DTH2242 Grip Pen */ | 365 | case 0x180802: /* DTH2242 Pen */ |
366 | wacom->tool[idx] = BTN_TOOL_PEN; | 366 | wacom->tool[idx] = BTN_TOOL_PEN; |
367 | break; | 367 | break; |
368 | 368 | ||
@@ -400,6 +400,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
400 | case 0x10090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */ | 400 | case 0x10090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */ |
401 | case 0x10080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */ | 401 | case 0x10080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */ |
402 | case 0x16080a: /* Cintiq 13HD Pro Pen Eraser */ | 402 | case 0x16080a: /* Cintiq 13HD Pro Pen Eraser */ |
403 | case 0x18080a: /* DTH2242 Eraser */ | ||
403 | wacom->tool[idx] = BTN_TOOL_RUBBER; | 404 | wacom->tool[idx] = BTN_TOOL_RUBBER; |
404 | break; | 405 | break; |
405 | 406 | ||
@@ -550,6 +551,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
550 | input_report_key(input, BTN_3, (data[6] & 0x08)); | 551 | input_report_key(input, BTN_3, (data[6] & 0x08)); |
551 | input_report_key(input, BTN_4, (data[6] & 0x10)); | 552 | input_report_key(input, BTN_4, (data[6] & 0x10)); |
552 | input_report_key(input, BTN_5, (data[6] & 0x20)); | 553 | input_report_key(input, BTN_5, (data[6] & 0x20)); |
554 | if (data[6] & 0x3f) { | ||
555 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); | ||
556 | } else { | ||
557 | input_report_abs(input, ABS_MISC, 0); | ||
558 | } | ||
553 | } else if (features->type == WACOM_13HD) { | 559 | } else if (features->type == WACOM_13HD) { |
554 | input_report_key(input, BTN_0, (data[3] & 0x01)); | 560 | input_report_key(input, BTN_0, (data[3] & 0x01)); |
555 | input_report_key(input, BTN_1, (data[4] & 0x01)); | 561 | input_report_key(input, BTN_1, (data[4] & 0x01)); |
@@ -560,6 +566,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
560 | input_report_key(input, BTN_6, (data[4] & 0x20)); | 566 | input_report_key(input, BTN_6, (data[4] & 0x20)); |
561 | input_report_key(input, BTN_7, (data[4] & 0x40)); | 567 | input_report_key(input, BTN_7, (data[4] & 0x40)); |
562 | input_report_key(input, BTN_8, (data[4] & 0x80)); | 568 | input_report_key(input, BTN_8, (data[4] & 0x80)); |
569 | if ((data[3] & 0x01) | data[4]) { | ||
570 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); | ||
571 | } else { | ||
572 | input_report_abs(input, ABS_MISC, 0); | ||
573 | } | ||
563 | } else if (features->type == WACOM_24HD) { | 574 | } else if (features->type == WACOM_24HD) { |
564 | input_report_key(input, BTN_0, (data[6] & 0x01)); | 575 | input_report_key(input, BTN_0, (data[6] & 0x01)); |
565 | input_report_key(input, BTN_1, (data[6] & 0x02)); | 576 | input_report_key(input, BTN_1, (data[6] & 0x02)); |
@@ -1539,15 +1550,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1539 | __set_bit(KEY_PROG1, input_dev->keybit); | 1550 | __set_bit(KEY_PROG1, input_dev->keybit); |
1540 | __set_bit(KEY_PROG2, input_dev->keybit); | 1551 | __set_bit(KEY_PROG2, input_dev->keybit); |
1541 | __set_bit(KEY_PROG3, input_dev->keybit); | 1552 | __set_bit(KEY_PROG3, input_dev->keybit); |
1553 | |||
1554 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | ||
1555 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); | ||
1542 | /* fall through */ | 1556 | /* fall through */ |
1543 | 1557 | ||
1544 | case DTK: | 1558 | case DTK: |
1545 | for (i = 0; i < 6; i++) | 1559 | for (i = 0; i < 6; i++) |
1546 | __set_bit(BTN_0 + i, input_dev->keybit); | 1560 | __set_bit(BTN_0 + i, input_dev->keybit); |
1547 | 1561 | ||
1548 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | ||
1549 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); | ||
1550 | |||
1551 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | 1562 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
1552 | 1563 | ||
1553 | wacom_setup_cintiq(wacom_wac); | 1564 | wacom_setup_cintiq(wacom_wac); |