Skip to content

Commit c73a1af

Browse files
Pinglinuxdtor
authored andcommitted
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>
1 parent f0aacea commit c73a1af

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎drivers/input/tablet/wacom_wac.c‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
362362
case 0x100804: /* Intuos4/5 13HD/24HD Art Pen */
363363
case 0x140802: /* Intuos4/5 13HD/24HD Classic Pen */
364364
case 0x160802: /* Cintiq 13HD Pro Pen */
365-
case 0x180802: /* DTH2242 Grip Pen */
365+
case 0x180802: /* DTH2242 Pen */
366366
wacom->tool[idx] = BTN_TOOL_PEN;
367367
break;
368368

@@ -400,6 +400,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
400400
case 0x10090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
401401
case 0x10080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */
402402
case 0x16080a: /* Cintiq 13HD Pro Pen Eraser */
403+
case 0x18080a: /* DTH2242 Eraser */
403404
wacom->tool[idx] = BTN_TOOL_RUBBER;
404405
break;
405406

@@ -550,6 +551,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
550551
input_report_key(input, BTN_3, (data[6] & 0x08));
551552
input_report_key(input, BTN_4, (data[6] & 0x10));
552553
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+
}
553559
} else if (features->type == WACOM_13HD) {
554560
input_report_key(input, BTN_0, (data[3] & 0x01));
555561
input_report_key(input, BTN_1, (data[4] & 0x01));
@@ -560,6 +566,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
560566
input_report_key(input, BTN_6, (data[4] & 0x20));
561567
input_report_key(input, BTN_7, (data[4] & 0x40));
562568
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+
}
563574
} else if (features->type == WACOM_24HD) {
564575
input_report_key(input, BTN_0, (data[6] & 0x01));
565576
input_report_key(input, BTN_1, (data[6] & 0x02));
@@ -1539,15 +1550,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
15391550
__set_bit(KEY_PROG1, input_dev->keybit);
15401551
__set_bit(KEY_PROG2, input_dev->keybit);
15411552
__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);
15421556
/* fall through */
15431557

15441558
case DTK:
15451559
for (i = 0; i < 6; i++)
15461560
__set_bit(BTN_0 + i, input_dev->keybit);
15471561

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-
15511562
__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
15521563

15531564
wacom_setup_cintiq(wacom_wac);

0 commit comments

Comments
 (0)