hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/hid/wacom_wac.c
....@@ -1,15 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * drivers/input/tablet/wacom_wac.c
34 *
45 * USB Wacom tablet support - Wacom specific code
5
- *
66 */
77
88 /*
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
139 */
1410
1511 #include "wacom_wac.h"
....@@ -345,7 +341,7 @@
345341
346342 case 2: /* Mouse with wheel */
347343 input_report_key(input, BTN_MIDDLE, data[1] & 0x04);
348
- /* fall through */
344
+ fallthrough;
349345
350346 case 3: /* Mouse without wheel */
351347 wacom->tool[0] = BTN_TOOL_MOUSE;
....@@ -487,6 +483,8 @@
487483 int ring1 = 0, ring2 = 0;
488484 int strip1 = 0, strip2 = 0;
489485 bool prox = false;
486
+ bool wrench = false, keyboard = false, mute_touch = false, menu = false,
487
+ info = false;
490488
491489 /* pad packets. Works as a second tool and is always in prox */
492490 if (!(data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD ||
....@@ -516,10 +514,32 @@
516514 keys = ((data[3] & 0x1C) ? 1<<2 : 0) |
517515 ((data[4] & 0xE0) ? 1<<1 : 0) |
518516 ((data[4] & 0x07) ? 1<<0 : 0);
517
+ keyboard = !!(data[4] & 0xE0);
518
+ info = !!(data[3] & 0x1C);
519
+
520
+ if (features->oPid) {
521
+ mute_touch = !!(data[4] & 0x07);
522
+ if (mute_touch)
523
+ wacom->shared->is_touch_on =
524
+ !wacom->shared->is_touch_on;
525
+ } else {
526
+ wrench = !!(data[4] & 0x07);
527
+ }
519528 } else if (features->type == WACOM_27QHD) {
520529 nkeys = 3;
521530 keys = data[2] & 0x07;
522531
532
+ wrench = !!(data[2] & 0x01);
533
+ keyboard = !!(data[2] & 0x02);
534
+
535
+ if (features->oPid) {
536
+ mute_touch = !!(data[2] & 0x04);
537
+ if (mute_touch)
538
+ wacom->shared->is_touch_on =
539
+ !wacom->shared->is_touch_on;
540
+ } else {
541
+ menu = !!(data[2] & 0x04);
542
+ }
523543 input_report_abs(input, ABS_X, be16_to_cpup((__be16 *)&data[4]));
524544 input_report_abs(input, ABS_Y, be16_to_cpup((__be16 *)&data[6]));
525545 input_report_abs(input, ABS_Z, be16_to_cpup((__be16 *)&data[8]));
....@@ -565,6 +585,9 @@
565585 if (features->type == WACOM_22HD) {
566586 nkeys = 3;
567587 keys = data[9] & 0x07;
588
+
589
+ info = !!(data[9] & 0x01);
590
+ wrench = !!(data[9] & 0x02);
568591 }
569592 } else {
570593 buttons = ((data[6] & 0x10) << 5) |
....@@ -583,6 +606,18 @@
583606
584607 for (i = 0; i < nkeys; i++)
585608 input_report_key(input, KEY_PROG1 + i, keys & (1 << i));
609
+
610
+ input_report_key(input, KEY_BUTTONCONFIG, wrench);
611
+ input_report_key(input, KEY_ONSCREEN_KEYBOARD, keyboard);
612
+ input_report_key(input, KEY_CONTROLPANEL, menu);
613
+ input_report_key(input, KEY_INFO, info);
614
+
615
+ if (wacom->shared && wacom->shared->touch_input) {
616
+ input_report_switch(wacom->shared->touch_input,
617
+ SW_MUTE_DEVICE,
618
+ !wacom->shared->is_touch_on);
619
+ input_sync(wacom->shared->touch_input);
620
+ }
586621
587622 input_report_abs(input, ABS_RX, strip1);
588623 input_report_abs(input, ABS_RY, strip2);
....@@ -603,9 +638,26 @@
603638 return (tool_id & ~0xFFF) << 4 | (tool_id & 0xFFF);
604639 }
605640
641
+static bool wacom_is_art_pen(int tool_id)
642
+{
643
+ bool is_art_pen = false;
644
+
645
+ switch (tool_id) {
646
+ case 0x885: /* Intuos3 Marker Pen */
647
+ case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */
648
+ case 0x10804: /* Intuos4/5 13HD/24HD Art Pen */
649
+ is_art_pen = true;
650
+ break;
651
+ }
652
+ return is_art_pen;
653
+}
654
+
606655 static int wacom_intuos_get_tool_type(int tool_id)
607656 {
608
- int tool_type;
657
+ int tool_type = BTN_TOOL_PEN;
658
+
659
+ if (wacom_is_art_pen(tool_id))
660
+ return tool_type;
609661
610662 switch (tool_id) {
611663 case 0x812: /* Inking pen */
....@@ -620,12 +672,10 @@
620672 case 0x852:
621673 case 0x823: /* Intuos3 Grip Pen */
622674 case 0x813: /* Intuos3 Classic Pen */
623
- case 0x885: /* Intuos3 Marker Pen */
624675 case 0x802: /* Intuos4/5 13HD/24HD General Pen */
625
- case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */
626676 case 0x8e2: /* IntuosHT2 pen */
627677 case 0x022:
628
- case 0x10804: /* Intuos4/5 13HD/24HD Art Pen */
678
+ case 0x10842: /* MobileStudio Pro Pro Pen slim */
629679 case 0x14802: /* Intuos4/5 13HD/24HD Classic Pen */
630680 case 0x16802: /* Cintiq 13HD Pro Pen */
631681 case 0x18802: /* DTH2242 Pen */
....@@ -667,6 +717,7 @@
667717 case 0x1480a: /* Intuos4/5 13HD/24HD Classic Pen Eraser */
668718 case 0x1090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
669719 case 0x1080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */
720
+ case 0x1084a: /* MobileStudio Pro Pro Pen slim Eraser */
670721 case 0x1680a: /* Cintiq 13HD Pro Pen Eraser */
671722 case 0x1880a: /* DTH2242 Eraser */
672723 case 0x1080a: /* Intuos4/5 13HD/24HD General Pen Eraser */
....@@ -680,10 +731,6 @@
680731 case 0x902: /* Intuos4/5 13HD/24HD Airbrush */
681732 case 0x10902: /* Intuos4/5 13HD/24HD Airbrush */
682733 tool_type = BTN_TOOL_AIRBRUSH;
683
- break;
684
-
685
- default: /* Unknown tool */
686
- tool_type = BTN_TOOL_PEN;
687734 break;
688735 }
689736 return tool_type;
....@@ -1164,7 +1211,7 @@
11641211 case 0x04:
11651212 wacom_intuos_bt_process_data(wacom, data + i);
11661213 i += 10;
1167
- /* fall through */
1214
+ fallthrough;
11681215 case 0x03:
11691216 wacom_intuos_bt_process_data(wacom, data + i);
11701217 i += 10;
....@@ -1220,7 +1267,8 @@
12201267 unsigned char *data = wacom->data;
12211268 int i;
12221269
1223
- if (wacom->features.type == INTUOSP2_BT) {
1270
+ if (wacom->features.type == INTUOSP2_BT ||
1271
+ wacom->features.type == INTUOSP2S_BT) {
12241272 wacom->serial[0] = get_unaligned_le64(&data[99]);
12251273 wacom->id[0] = get_unaligned_le16(&data[107]);
12261274 pen_frame_len = 14;
....@@ -1272,7 +1320,8 @@
12721320 input_report_abs(pen_input, ABS_X, get_unaligned_le16(&frame[1]));
12731321 input_report_abs(pen_input, ABS_Y, get_unaligned_le16(&frame[3]));
12741322
1275
- if (wacom->features.type == INTUOSP2_BT) {
1323
+ if (wacom->features.type == INTUOSP2_BT ||
1324
+ wacom->features.type == INTUOSP2S_BT) {
12761325 /* Fix rotation alignment: userspace expects zero at left */
12771326 int16_t rotation =
12781327 (int16_t)get_unaligned_le16(&frame[9]);
....@@ -1290,10 +1339,10 @@
12901339 get_unaligned_le16(&frame[11]));
12911340 }
12921341 }
1293
-
12941342 if (wacom->tool[0]) {
12951343 input_report_abs(pen_input, ABS_PRESSURE, get_unaligned_le16(&frame[5]));
1296
- if (wacom->features.type == INTUOSP2_BT) {
1344
+ if (wacom->features.type == INTUOSP2_BT ||
1345
+ wacom->features.type == INTUOSP2S_BT) {
12971346 input_report_abs(pen_input, ABS_DISTANCE,
12981347 range ? frame[13] : wacom->features.distance_max);
12991348 } else {
....@@ -1388,11 +1437,13 @@
13881437 {
13891438 struct input_dev *pad_input = wacom->pad_input;
13901439 unsigned char *data = wacom->data;
1440
+ int nbuttons = wacom->features.numbered_buttons;
13911441
1392
- int buttons = data[282] | ((data[281] & 0x40) << 2);
1442
+ int expresskeys = data[282];
1443
+ int center = (data[281] & 0x40) >> 6;
13931444 int ring = data[285] & 0x7F;
13941445 bool ringstatus = data[285] & 0x80;
1395
- bool prox = buttons || ringstatus;
1446
+ bool prox = expresskeys || center || ringstatus;
13961447
13971448 /* Fix touchring data: userspace expects 0 at left and increasing clockwise */
13981449 ring = 71 - ring;
....@@ -1400,7 +1451,8 @@
14001451 if (ring > 71)
14011452 ring -= 72;
14021453
1403
- wacom_report_numbered_buttons(pad_input, 9, buttons);
1454
+ wacom_report_numbered_buttons(pad_input, nbuttons,
1455
+ expresskeys | (center << (nbuttons - 1)));
14041456
14051457 input_report_abs(pad_input, ABS_WHEEL, ringstatus ? ring : 0);
14061458
....@@ -1460,7 +1512,8 @@
14601512 }
14611513
14621514 wacom_intuos_pro2_bt_pen(wacom);
1463
- if (wacom->features.type == INTUOSP2_BT) {
1515
+ if (wacom->features.type == INTUOSP2_BT ||
1516
+ wacom->features.type == INTUOSP2S_BT) {
14641517 wacom_intuos_pro2_bt_touch(wacom);
14651518 wacom_intuos_pro2_bt_pad(wacom);
14661519 wacom_intuos_pro2_bt_battery(wacom);
....@@ -1481,6 +1534,12 @@
14811534 int num_contacts_left = 4; /* maximum contacts per packet */
14821535 int byte_per_packet = WACOM_BYTES_PER_24HDT_PACKET;
14831536 int y_offset = 2;
1537
+
1538
+ if (wacom->shared->has_mute_touch_switch &&
1539
+ !wacom->shared->is_touch_on) {
1540
+ if (!wacom->shared->touch_down)
1541
+ return 0;
1542
+ }
14841543
14851544 if (wacom->features.type == WACOM_27QHDT) {
14861545 current_num_contacts = data[63];
....@@ -1772,6 +1831,9 @@
17721831 int subpage = (usage & 0xFF00) << 8;
17731832 int subusage = (usage & 0xFF);
17741833
1834
+ if (usage == WACOM_HID_WT_REPORT_VALID)
1835
+ return usage;
1836
+
17751837 if (subpage == HID_UP_UNDEFINED)
17761838 subpage = WACOM_HID_SP_DIGITIZER;
17771839
....@@ -1954,7 +2016,6 @@
19542016 wacom_wac->has_mute_touch_switch = true;
19552017 usage->type = EV_SW;
19562018 usage->code = SW_MUTE_DEVICE;
1957
- features->device_type |= WACOM_DEVICETYPE_PAD;
19582019 break;
19592020 case WACOM_HID_WD_TOUCHSTRIP:
19602021 wacom_map_usage(input, usage, field, EV_ABS, ABS_RX, 0);
....@@ -2034,37 +2095,12 @@
20342095 wacom_wac->hid_data.inrange_state |= value;
20352096 }
20362097
2037
- switch (equivalent_usage) {
2038
- case WACOM_HID_WD_TOUCHRING:
2039
- /*
2040
- * Userspace expects touchrings to increase in value with
2041
- * clockwise gestures and have their zero point at the
2042
- * tablet's left. HID events "should" be clockwise-
2043
- * increasing and zero at top, though the MobileStudio
2044
- * Pro and 2nd-gen Intuos Pro don't do this...
2045
- */
2046
- if (hdev->vendor == 0x56a &&
2047
- (hdev->product == 0x34d || hdev->product == 0x34e || /* MobileStudio Pro */
2048
- hdev->product == 0x357 || hdev->product == 0x358)) { /* Intuos Pro 2 */
2049
- value = (field->logical_maximum - value);
2050
-
2051
- if (hdev->product == 0x357 || hdev->product == 0x358)
2052
- value = wacom_offset_rotation(input, usage, value, 3, 16);
2053
- else if (hdev->product == 0x34d || hdev->product == 0x34e)
2054
- value = wacom_offset_rotation(input, usage, value, 1, 2);
2055
- }
2056
- else {
2057
- value = wacom_offset_rotation(input, usage, value, 1, 4);
2058
- }
2059
- do_report = true;
2060
- break;
2061
- case WACOM_HID_WD_TOUCHRINGSTATUS:
2062
- if (!value)
2063
- input_event(input, usage->type, usage->code, 0);
2064
- break;
2065
-
2066
- case WACOM_HID_WD_MUTE_DEVICE:
2067
- case WACOM_HID_WD_TOUCHONOFF:
2098
+ /* Process touch switch state first since it is reported through touch interface,
2099
+ * which is indepentent of pad interface. In the case when there are no other pad
2100
+ * events, the pad interface will not even be created.
2101
+ */
2102
+ if ((equivalent_usage == WACOM_HID_WD_MUTE_DEVICE) ||
2103
+ (equivalent_usage == WACOM_HID_WD_TOUCHONOFF)) {
20682104 if (wacom_wac->shared->touch_input) {
20692105 bool *is_touch_on = &wacom_wac->shared->is_touch_on;
20702106
....@@ -2077,6 +2113,45 @@
20772113 SW_MUTE_DEVICE, !(*is_touch_on));
20782114 input_sync(wacom_wac->shared->touch_input);
20792115 }
2116
+ return;
2117
+ }
2118
+
2119
+ if (!input)
2120
+ return;
2121
+
2122
+ switch (equivalent_usage) {
2123
+ case WACOM_HID_WD_TOUCHRING:
2124
+ /*
2125
+ * Userspace expects touchrings to increase in value with
2126
+ * clockwise gestures and have their zero point at the
2127
+ * tablet's left. HID events "should" be clockwise-
2128
+ * increasing and zero at top, though the MobileStudio
2129
+ * Pro and 2nd-gen Intuos Pro don't do this...
2130
+ */
2131
+ if (hdev->vendor == 0x56a &&
2132
+ (hdev->product == 0x34d || hdev->product == 0x34e || /* MobileStudio Pro */
2133
+ hdev->product == 0x357 || hdev->product == 0x358 || /* Intuos Pro 2 */
2134
+ hdev->product == 0x392 || /* Intuos Pro 2 */
2135
+ hdev->product == 0x398 || hdev->product == 0x399 || /* MobileStudio Pro */
2136
+ hdev->product == 0x3AA)) { /* MobileStudio Pro */
2137
+ value = (field->logical_maximum - value);
2138
+
2139
+ if (hdev->product == 0x357 || hdev->product == 0x358 ||
2140
+ hdev->product == 0x392)
2141
+ value = wacom_offset_rotation(input, usage, value, 3, 16);
2142
+ else if (hdev->product == 0x34d || hdev->product == 0x34e ||
2143
+ hdev->product == 0x398 || hdev->product == 0x399 ||
2144
+ hdev->product == 0x3AA)
2145
+ value = wacom_offset_rotation(input, usage, value, 1, 2);
2146
+ }
2147
+ else {
2148
+ value = wacom_offset_rotation(input, usage, value, 1, 4);
2149
+ }
2150
+ do_report = true;
2151
+ break;
2152
+ case WACOM_HID_WD_TOUCHRINGSTATUS:
2153
+ if (!value)
2154
+ input_event(input, usage->type, usage->code, 0);
20802155 break;
20812156
20822157 case WACOM_HID_WD_MODE_CHANGE:
....@@ -2090,7 +2165,7 @@
20902165 for (i = 0; i < wacom->led.count; i++)
20912166 wacom_update_led(wacom, features->numbered_buttons,
20922167 value, i);
2093
- /* fall through*/
2168
+ fallthrough;
20942169 default:
20952170 do_report = true;
20962171 break;
....@@ -2181,27 +2256,6 @@
21812256 case HID_DG_TOOLSERIALNUMBER:
21822257 features->quirks |= WACOM_QUIRK_TOOLSERIAL;
21832258 wacom_map_usage(input, usage, field, EV_MSC, MSC_SERIAL, 0);
2184
-
2185
- /* Adjust AES usages to match modern convention */
2186
- if (usage->hid == WACOM_HID_WT_SERIALNUMBER && field->report_size == 16) {
2187
- if (field->index + 2 < field->report->maxfield) {
2188
- struct hid_field *a = field->report->field[field->index + 1];
2189
- struct hid_field *b = field->report->field[field->index + 2];
2190
-
2191
- if (a->maxusage > 0 && a->usage[0].hid == HID_DG_TOOLSERIALNUMBER && a->report_size == 32 &&
2192
- b->maxusage > 0 && b->usage[0].hid == 0xFF000000 && b->report_size == 8) {
2193
- features->quirks |= WACOM_QUIRK_AESPEN;
2194
- usage->hid = WACOM_HID_WD_TOOLTYPE;
2195
- field->logical_minimum = S16_MIN;
2196
- field->logical_maximum = S16_MAX;
2197
- a->logical_minimum = S32_MIN;
2198
- a->logical_maximum = S32_MAX;
2199
- b->usage[0].hid = WACOM_HID_WD_SERIALHI;
2200
- b->logical_minimum = 0;
2201
- b->logical_maximum = U8_MAX;
2202
- }
2203
- }
2204
- }
22052259 break;
22062260 case WACOM_HID_WD_SENSE:
22072261 features->quirks |= WACOM_QUIRK_SENSE;
....@@ -2275,6 +2329,9 @@
22752329 }
22762330 return;
22772331 case HID_DG_TWIST:
2332
+ /* don't modify the value if the pen doesn't support the feature */
2333
+ if (!wacom_is_art_pen(wacom_wac->id[0])) return;
2334
+
22782335 /*
22792336 * Userspace expects pen twist to have its zero point when
22802337 * the buttons/finger is on the tablet's left. HID values
....@@ -2555,6 +2612,9 @@
25552612 unsigned equivalent_usage = wacom_equivalent_usage(usage->hid);
25562613 struct wacom_features *features = &wacom->wacom_wac.features;
25572614
2615
+ if (wacom_wac->is_invalid_bt_frame)
2616
+ return;
2617
+
25582618 switch (equivalent_usage) {
25592619 case HID_DG_CONFIDENCE:
25602620 wacom_wac->hid_data.confidence = value;
....@@ -2577,6 +2637,9 @@
25772637 case HID_DG_TIPSWITCH:
25782638 wacom_wac->hid_data.tipswitch = value;
25792639 break;
2640
+ case WACOM_HID_WT_REPORT_VALID:
2641
+ wacom_wac->is_invalid_bt_frame = !value;
2642
+ return;
25802643 case HID_DG_CONTACTMAX:
25812644 if (!features->touch_max) {
25822645 features->touch_max = value;
....@@ -2586,7 +2649,6 @@
25862649 }
25872650 return;
25882651 }
2589
-
25902652
25912653 if (usage->usage_index + 1 == field->report_count) {
25922654 if (equivalent_usage == wacom_wac->hid_data.last_slot_field) {
....@@ -2607,6 +2669,8 @@
26072669 struct wacom_wac *wacom_wac = &wacom->wacom_wac;
26082670 struct hid_data* hid_data = &wacom_wac->hid_data;
26092671 int i;
2672
+
2673
+ wacom_wac->is_invalid_bt_frame = false;
26102674
26112675 hid_data->confidence = true;
26122676
....@@ -2719,7 +2783,7 @@
27192783 /* usage tests must precede field tests */
27202784 if (WACOM_BATTERY_USAGE(usage))
27212785 wacom_wac_battery_event(hdev, field, usage, value);
2722
- else if (WACOM_PAD_FIELD(field) && wacom->wacom_wac.pad_input)
2786
+ else if (WACOM_PAD_FIELD(field))
27232787 wacom_wac_pad_event(hdev, field, usage, value);
27242788 else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input)
27252789 wacom_wac_pen_event(hdev, field, usage, value);
....@@ -3299,6 +3363,7 @@
32993363 break;
33003364
33013365 case INTUOSP2_BT:
3366
+ case INTUOSP2S_BT:
33023367 case INTUOSHT3_BT:
33033368 sync = wacom_intuos_pro2_bt_irq(wacom_wac, len);
33043369 break;
....@@ -3479,7 +3544,8 @@
34793544 if (features->type == REMOTE)
34803545 features->device_type = WACOM_DEVICETYPE_PAD;
34813546
3482
- if (features->type == INTUOSP2_BT) {
3547
+ if (features->type == INTUOSP2_BT ||
3548
+ features->type == INTUOSP2S_BT) {
34833549 features->device_type |= WACOM_DEVICETYPE_PEN |
34843550 WACOM_DEVICETYPE_PAD |
34853551 WACOM_DEVICETYPE_TOUCH;
....@@ -3599,13 +3665,14 @@
35993665 switch (features->type) {
36003666 case GRAPHIRE_BT:
36013667 __clear_bit(ABS_MISC, input_dev->absbit);
3668
+ fallthrough;
36023669
36033670 case WACOM_MO:
36043671 case WACOM_G4:
36053672 input_set_abs_params(input_dev, ABS_DISTANCE, 0,
36063673 features->distance_max,
36073674 features->distance_fuzz, 0);
3608
- /* fall through */
3675
+ fallthrough;
36093676
36103677 case GRAPHIRE:
36113678 input_set_capability(input_dev, EV_REL, REL_WHEEL);
....@@ -3645,7 +3712,7 @@
36453712 case INTUOS4S:
36463713 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
36473714 input_abs_set_res(input_dev, ABS_Z, 287);
3648
- /* fall through */
3715
+ fallthrough;
36493716
36503717 case INTUOS:
36513718 wacom_setup_intuos(wacom_wac);
....@@ -3658,6 +3725,7 @@
36583725 case INTUOS5S:
36593726 case INTUOSPS:
36603727 case INTUOSP2_BT:
3728
+ case INTUOSP2S_BT:
36613729 input_set_abs_params(input_dev, ABS_DISTANCE, 0,
36623730 features->distance_max,
36633731 features->distance_fuzz, 0);
....@@ -3677,7 +3745,7 @@
36773745 case TABLETPC:
36783746 case TABLETPCE:
36793747 __clear_bit(ABS_MISC, input_dev->absbit);
3680
- /* fall through */
3748
+ fallthrough;
36813749
36823750 case DTUS:
36833751 case DTUSX:
....@@ -3691,7 +3759,7 @@
36913759
36923760 case PTU:
36933761 __set_bit(BTN_STYLUS2, input_dev->keybit);
3694
- /* fall through */
3762
+ fallthrough;
36953763
36963764 case PENPARTNER:
36973765 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
....@@ -3768,6 +3836,7 @@
37683836
37693837 switch (features->type) {
37703838 case INTUOSP2_BT:
3839
+ case INTUOSP2S_BT:
37713840 input_dev->evbit[0] |= BIT_MASK(EV_SW);
37723841 __set_bit(SW_MUTE_DEVICE, input_dev->swbit);
37733842
....@@ -3783,10 +3852,16 @@
37833852 input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
37843853 0, 5920, 4, 0);
37853854 }
3855
+ else if (wacom_wac->shared->touch->product == 0x393) {
3856
+ input_set_abs_params(input_dev, ABS_MT_POSITION_X,
3857
+ 0, 6400, 4, 0);
3858
+ input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
3859
+ 0, 4000, 4, 0);
3860
+ }
37863861 input_abs_set_res(input_dev, ABS_MT_POSITION_X, 40);
37873862 input_abs_set_res(input_dev, ABS_MT_POSITION_Y, 40);
37883863
3789
- /* fall through */
3864
+ fallthrough;
37903865
37913866 case INTUOS5:
37923867 case INTUOS5L:
....@@ -3804,15 +3879,23 @@
38043879 input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, 0, features->x_max, 0, 0);
38053880 input_set_abs_params(input_dev, ABS_MT_WIDTH_MINOR, 0, features->y_max, 0, 0);
38063881 input_set_abs_params(input_dev, ABS_MT_ORIENTATION, 0, 1, 0, 0);
3807
- /* fall through */
3882
+ fallthrough;
38083883
38093884 case WACOM_27QHDT:
3885
+ if (wacom_wac->shared->touch->product == 0x32C ||
3886
+ wacom_wac->shared->touch->product == 0xF6) {
3887
+ input_dev->evbit[0] |= BIT_MASK(EV_SW);
3888
+ __set_bit(SW_MUTE_DEVICE, input_dev->swbit);
3889
+ wacom_wac->has_mute_touch_switch = true;
3890
+ }
3891
+ fallthrough;
3892
+
38103893 case MTSCREEN:
38113894 case MTTPC:
38123895 case MTTPC_B:
38133896 case TABLETPC2FG:
38143897 input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_DIRECT);
3815
- /*fall through */
3898
+ fallthrough;
38163899
38173900 case TABLETPC:
38183901 case TABLETPCE:
....@@ -3822,7 +3905,7 @@
38223905 case INTUOSHT2:
38233906 input_dev->evbit[0] |= BIT_MASK(EV_SW);
38243907 __set_bit(SW_MUTE_DEVICE, input_dev->swbit);
3825
- /* fall through */
3908
+ fallthrough;
38263909
38273910 case BAMBOO_PT:
38283911 case BAMBOO_TOUCH:
....@@ -4042,6 +4125,12 @@
40424125 __set_bit(KEY_PROG2, input_dev->keybit);
40434126 __set_bit(KEY_PROG3, input_dev->keybit);
40444127
4128
+ __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit);
4129
+ __set_bit(KEY_INFO, input_dev->keybit);
4130
+
4131
+ if (!features->oPid)
4132
+ __set_bit(KEY_BUTTONCONFIG, input_dev->keybit);
4133
+
40454134 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
40464135 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
40474136 break;
....@@ -4050,6 +4139,12 @@
40504139 __set_bit(KEY_PROG1, input_dev->keybit);
40514140 __set_bit(KEY_PROG2, input_dev->keybit);
40524141 __set_bit(KEY_PROG3, input_dev->keybit);
4142
+
4143
+ __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit);
4144
+ __set_bit(KEY_BUTTONCONFIG, input_dev->keybit);
4145
+
4146
+ if (!features->oPid)
4147
+ __set_bit(KEY_CONTROLPANEL, input_dev->keybit);
40534148 input_set_abs_params(input_dev, ABS_X, -2048, 2048, 0, 0);
40544149 input_abs_set_res(input_dev, ABS_X, 1024); /* points/g */
40554150 input_set_abs_params(input_dev, ABS_Y, -2048, 2048, 0, 0);
....@@ -4063,7 +4158,10 @@
40634158 __set_bit(KEY_PROG1, input_dev->keybit);
40644159 __set_bit(KEY_PROG2, input_dev->keybit);
40654160 __set_bit(KEY_PROG3, input_dev->keybit);
4066
- /* fall through */
4161
+
4162
+ __set_bit(KEY_BUTTONCONFIG, input_dev->keybit);
4163
+ __set_bit(KEY_INFO, input_dev->keybit);
4164
+ fallthrough;
40674165
40684166 case WACOM_21UX2:
40694167 case WACOM_BEE:
....@@ -4079,7 +4177,7 @@
40794177 case INTUOS3:
40804178 case INTUOS3L:
40814179 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
4082
- /* fall through */
4180
+ fallthrough;
40834181
40844182 case INTUOS3S:
40854183 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
....@@ -4092,6 +4190,7 @@
40924190 case INTUOS5S:
40934191 case INTUOSPS:
40944192 case INTUOSP2_BT:
4193
+ case INTUOSP2S_BT:
40954194 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
40964195 break;
40974196
....@@ -4102,7 +4201,7 @@
41024201 * ID_INPUT_TABLET to be set.
41034202 */
41044203 __set_bit(BTN_STYLUS, input_dev->keybit);
4105
- /* fall through */
4204
+ fallthrough;
41064205
41074206 case INTUOS4:
41084207 case INTUOS4L:
....@@ -4669,6 +4768,16 @@
46694768 static const struct wacom_features wacom_features_0x37B =
46704769 { "Wacom One by Wacom M", 21600, 13500, 2047, 63,
46714770 BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
4771
+static const struct wacom_features wacom_features_0x393 =
4772
+ { "Wacom Intuos Pro S", 31920, 19950, 8191, 63,
4773
+ INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7,
4774
+ .touch_max = 10 };
4775
+static const struct wacom_features wacom_features_0x3c6 =
4776
+ { "Wacom Intuos BT S", 15200, 9500, 4095, 63,
4777
+ INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
4778
+static const struct wacom_features wacom_features_0x3c8 =
4779
+ { "Wacom Intuos BT M", 21600, 13500, 4095, 63,
4780
+ INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
46724781
46734782 static const struct wacom_features wacom_features_HID_ANY_ID =
46744783 { "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
....@@ -4841,6 +4950,9 @@
48414950 { BT_DEVICE_WACOM(0x379) },
48424951 { USB_DEVICE_WACOM(0x37A) },
48434952 { USB_DEVICE_WACOM(0x37B) },
4953
+ { BT_DEVICE_WACOM(0x393) },
4954
+ { BT_DEVICE_WACOM(0x3c6) },
4955
+ { BT_DEVICE_WACOM(0x3c8) },
48444956 { USB_DEVICE_WACOM(0x4001) },
48454957 { USB_DEVICE_WACOM(0x4004) },
48464958 { USB_DEVICE_WACOM(0x5000) },