.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * drivers/input/tablet/wacom_wac.c |
---|
3 | 4 | * |
---|
4 | 5 | * USB Wacom tablet support - Wacom specific code |
---|
5 | | - * |
---|
6 | 6 | */ |
---|
7 | 7 | |
---|
8 | 8 | /* |
---|
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. |
---|
13 | 9 | */ |
---|
14 | 10 | |
---|
15 | 11 | #include "wacom_wac.h" |
---|
16 | 12 | #include "wacom.h" |
---|
17 | 13 | #include <linux/input/mt.h> |
---|
| 14 | +#include <linux/jiffies.h> |
---|
18 | 15 | |
---|
19 | 16 | /* resolution for penabled devices */ |
---|
20 | 17 | #define WACOM_PL_RES 20 |
---|
.. | .. |
---|
45 | 42 | |
---|
46 | 43 | static void wacom_update_led(struct wacom *wacom, int button_count, int mask, |
---|
47 | 44 | int group); |
---|
| 45 | + |
---|
| 46 | +static void wacom_force_proxout(struct wacom_wac *wacom_wac) |
---|
| 47 | +{ |
---|
| 48 | + struct input_dev *input = wacom_wac->pen_input; |
---|
| 49 | + |
---|
| 50 | + wacom_wac->shared->stylus_in_proximity = 0; |
---|
| 51 | + |
---|
| 52 | + input_report_key(input, BTN_TOUCH, 0); |
---|
| 53 | + input_report_key(input, BTN_STYLUS, 0); |
---|
| 54 | + input_report_key(input, BTN_STYLUS2, 0); |
---|
| 55 | + input_report_key(input, BTN_STYLUS3, 0); |
---|
| 56 | + input_report_key(input, wacom_wac->tool[0], 0); |
---|
| 57 | + if (wacom_wac->serial[0]) { |
---|
| 58 | + input_report_abs(input, ABS_MISC, 0); |
---|
| 59 | + } |
---|
| 60 | + input_report_abs(input, ABS_PRESSURE, 0); |
---|
| 61 | + |
---|
| 62 | + wacom_wac->tool[0] = 0; |
---|
| 63 | + wacom_wac->id[0] = 0; |
---|
| 64 | + wacom_wac->serial[0] = 0; |
---|
| 65 | + |
---|
| 66 | + input_sync(input); |
---|
| 67 | +} |
---|
| 68 | + |
---|
| 69 | +void wacom_idleprox_timeout(struct timer_list *list) |
---|
| 70 | +{ |
---|
| 71 | + struct wacom *wacom = from_timer(wacom, list, idleprox_timer); |
---|
| 72 | + struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
---|
| 73 | + |
---|
| 74 | + if (!wacom_wac->hid_data.sense_state) { |
---|
| 75 | + return; |
---|
| 76 | + } |
---|
| 77 | + |
---|
| 78 | + hid_warn(wacom->hdev, "%s: tool appears to be hung in-prox. forcing it out.\n", __func__); |
---|
| 79 | + wacom_force_proxout(wacom_wac); |
---|
| 80 | +} |
---|
| 81 | + |
---|
48 | 82 | /* |
---|
49 | 83 | * Percent of battery capacity for Graphire. |
---|
50 | 84 | * 8th value means AC online and show 100% capacity. |
---|
.. | .. |
---|
345 | 379 | |
---|
346 | 380 | case 2: /* Mouse with wheel */ |
---|
347 | 381 | input_report_key(input, BTN_MIDDLE, data[1] & 0x04); |
---|
348 | | - /* fall through */ |
---|
| 382 | + fallthrough; |
---|
349 | 383 | |
---|
350 | 384 | case 3: /* Mouse without wheel */ |
---|
351 | 385 | wacom->tool[0] = BTN_TOOL_MOUSE; |
---|
.. | .. |
---|
487 | 521 | int ring1 = 0, ring2 = 0; |
---|
488 | 522 | int strip1 = 0, strip2 = 0; |
---|
489 | 523 | bool prox = false; |
---|
| 524 | + bool wrench = false, keyboard = false, mute_touch = false, menu = false, |
---|
| 525 | + info = false; |
---|
490 | 526 | |
---|
491 | 527 | /* pad packets. Works as a second tool and is always in prox */ |
---|
492 | 528 | if (!(data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD || |
---|
.. | .. |
---|
516 | 552 | keys = ((data[3] & 0x1C) ? 1<<2 : 0) | |
---|
517 | 553 | ((data[4] & 0xE0) ? 1<<1 : 0) | |
---|
518 | 554 | ((data[4] & 0x07) ? 1<<0 : 0); |
---|
| 555 | + keyboard = !!(data[4] & 0xE0); |
---|
| 556 | + info = !!(data[3] & 0x1C); |
---|
| 557 | + |
---|
| 558 | + if (features->oPid) { |
---|
| 559 | + mute_touch = !!(data[4] & 0x07); |
---|
| 560 | + if (mute_touch) |
---|
| 561 | + wacom->shared->is_touch_on = |
---|
| 562 | + !wacom->shared->is_touch_on; |
---|
| 563 | + } else { |
---|
| 564 | + wrench = !!(data[4] & 0x07); |
---|
| 565 | + } |
---|
519 | 566 | } else if (features->type == WACOM_27QHD) { |
---|
520 | 567 | nkeys = 3; |
---|
521 | 568 | keys = data[2] & 0x07; |
---|
522 | 569 | |
---|
| 570 | + wrench = !!(data[2] & 0x01); |
---|
| 571 | + keyboard = !!(data[2] & 0x02); |
---|
| 572 | + |
---|
| 573 | + if (features->oPid) { |
---|
| 574 | + mute_touch = !!(data[2] & 0x04); |
---|
| 575 | + if (mute_touch) |
---|
| 576 | + wacom->shared->is_touch_on = |
---|
| 577 | + !wacom->shared->is_touch_on; |
---|
| 578 | + } else { |
---|
| 579 | + menu = !!(data[2] & 0x04); |
---|
| 580 | + } |
---|
523 | 581 | input_report_abs(input, ABS_X, be16_to_cpup((__be16 *)&data[4])); |
---|
524 | 582 | input_report_abs(input, ABS_Y, be16_to_cpup((__be16 *)&data[6])); |
---|
525 | 583 | input_report_abs(input, ABS_Z, be16_to_cpup((__be16 *)&data[8])); |
---|
.. | .. |
---|
565 | 623 | if (features->type == WACOM_22HD) { |
---|
566 | 624 | nkeys = 3; |
---|
567 | 625 | keys = data[9] & 0x07; |
---|
| 626 | + |
---|
| 627 | + info = !!(data[9] & 0x01); |
---|
| 628 | + wrench = !!(data[9] & 0x02); |
---|
568 | 629 | } |
---|
569 | 630 | } else { |
---|
570 | 631 | buttons = ((data[6] & 0x10) << 5) | |
---|
.. | .. |
---|
583 | 644 | |
---|
584 | 645 | for (i = 0; i < nkeys; i++) |
---|
585 | 646 | input_report_key(input, KEY_PROG1 + i, keys & (1 << i)); |
---|
| 647 | + |
---|
| 648 | + input_report_key(input, KEY_BUTTONCONFIG, wrench); |
---|
| 649 | + input_report_key(input, KEY_ONSCREEN_KEYBOARD, keyboard); |
---|
| 650 | + input_report_key(input, KEY_CONTROLPANEL, menu); |
---|
| 651 | + input_report_key(input, KEY_INFO, info); |
---|
| 652 | + |
---|
| 653 | + if (wacom->shared && wacom->shared->touch_input) { |
---|
| 654 | + input_report_switch(wacom->shared->touch_input, |
---|
| 655 | + SW_MUTE_DEVICE, |
---|
| 656 | + !wacom->shared->is_touch_on); |
---|
| 657 | + input_sync(wacom->shared->touch_input); |
---|
| 658 | + } |
---|
586 | 659 | |
---|
587 | 660 | input_report_abs(input, ABS_RX, strip1); |
---|
588 | 661 | input_report_abs(input, ABS_RY, strip2); |
---|
.. | .. |
---|
603 | 676 | return (tool_id & ~0xFFF) << 4 | (tool_id & 0xFFF); |
---|
604 | 677 | } |
---|
605 | 678 | |
---|
| 679 | +static bool wacom_is_art_pen(int tool_id) |
---|
| 680 | +{ |
---|
| 681 | + bool is_art_pen = false; |
---|
| 682 | + |
---|
| 683 | + switch (tool_id) { |
---|
| 684 | + case 0x885: /* Intuos3 Marker Pen */ |
---|
| 685 | + case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */ |
---|
| 686 | + case 0x10804: /* Intuos4/5 13HD/24HD Art Pen */ |
---|
| 687 | + is_art_pen = true; |
---|
| 688 | + break; |
---|
| 689 | + } |
---|
| 690 | + return is_art_pen; |
---|
| 691 | +} |
---|
| 692 | + |
---|
606 | 693 | static int wacom_intuos_get_tool_type(int tool_id) |
---|
607 | 694 | { |
---|
608 | | - int tool_type; |
---|
| 695 | + int tool_type = BTN_TOOL_PEN; |
---|
| 696 | + |
---|
| 697 | + if (wacom_is_art_pen(tool_id)) |
---|
| 698 | + return tool_type; |
---|
609 | 699 | |
---|
610 | 700 | switch (tool_id) { |
---|
611 | 701 | case 0x812: /* Inking pen */ |
---|
.. | .. |
---|
620 | 710 | case 0x852: |
---|
621 | 711 | case 0x823: /* Intuos3 Grip Pen */ |
---|
622 | 712 | case 0x813: /* Intuos3 Classic Pen */ |
---|
623 | | - case 0x885: /* Intuos3 Marker Pen */ |
---|
624 | 713 | case 0x802: /* Intuos4/5 13HD/24HD General Pen */ |
---|
625 | | - case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */ |
---|
626 | 714 | case 0x8e2: /* IntuosHT2 pen */ |
---|
627 | 715 | case 0x022: |
---|
628 | | - case 0x10804: /* Intuos4/5 13HD/24HD Art Pen */ |
---|
| 716 | + case 0x200: /* Pro Pen 3 */ |
---|
| 717 | + case 0x04200: /* Pro Pen 3 */ |
---|
| 718 | + case 0x10842: /* MobileStudio Pro Pro Pen slim */ |
---|
629 | 719 | case 0x14802: /* Intuos4/5 13HD/24HD Classic Pen */ |
---|
630 | 720 | case 0x16802: /* Cintiq 13HD Pro Pen */ |
---|
631 | 721 | case 0x18802: /* DTH2242 Pen */ |
---|
632 | 722 | case 0x10802: /* Intuos4/5 13HD/24HD General Pen */ |
---|
| 723 | + case 0x80842: /* Intuos Pro and Cintiq Pro 3D Pen */ |
---|
633 | 724 | tool_type = BTN_TOOL_PEN; |
---|
634 | 725 | break; |
---|
635 | 726 | |
---|
.. | .. |
---|
667 | 758 | case 0x1480a: /* Intuos4/5 13HD/24HD Classic Pen Eraser */ |
---|
668 | 759 | case 0x1090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */ |
---|
669 | 760 | case 0x1080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */ |
---|
| 761 | + case 0x1084a: /* MobileStudio Pro Pro Pen slim Eraser */ |
---|
670 | 762 | case 0x1680a: /* Cintiq 13HD Pro Pen Eraser */ |
---|
671 | 763 | case 0x1880a: /* DTH2242 Eraser */ |
---|
672 | 764 | case 0x1080a: /* Intuos4/5 13HD/24HD General Pen Eraser */ |
---|
.. | .. |
---|
680 | 772 | case 0x902: /* Intuos4/5 13HD/24HD Airbrush */ |
---|
681 | 773 | case 0x10902: /* Intuos4/5 13HD/24HD Airbrush */ |
---|
682 | 774 | tool_type = BTN_TOOL_AIRBRUSH; |
---|
683 | | - break; |
---|
684 | | - |
---|
685 | | - default: /* Unknown tool */ |
---|
686 | | - tool_type = BTN_TOOL_PEN; |
---|
687 | 775 | break; |
---|
688 | 776 | } |
---|
689 | 777 | return tool_type; |
---|
.. | .. |
---|
743 | 831 | /* Enter report */ |
---|
744 | 832 | if ((data[1] & 0xfc) == 0xc0) { |
---|
745 | 833 | /* serial number of the tool */ |
---|
746 | | - wacom->serial[idx] = ((data[3] & 0x0f) << 28) + |
---|
| 834 | + wacom->serial[idx] = ((__u64)(data[3] & 0x0f) << 28) + |
---|
747 | 835 | (data[4] << 20) + (data[5] << 12) + |
---|
748 | 836 | (data[6] << 4) + (data[7] >> 4); |
---|
749 | 837 | |
---|
.. | .. |
---|
1039 | 1127 | if (index < 0 || !remote->remotes[index].registered) |
---|
1040 | 1128 | goto out; |
---|
1041 | 1129 | |
---|
| 1130 | + remote->remotes[i].active_time = ktime_get(); |
---|
1042 | 1131 | input = remote->remotes[index].input; |
---|
1043 | 1132 | |
---|
1044 | 1133 | input_report_key(input, BTN_0, (data[9] & 0x01)); |
---|
.. | .. |
---|
1164 | 1253 | case 0x04: |
---|
1165 | 1254 | wacom_intuos_bt_process_data(wacom, data + i); |
---|
1166 | 1255 | i += 10; |
---|
1167 | | - /* fall through */ |
---|
| 1256 | + fallthrough; |
---|
1168 | 1257 | case 0x03: |
---|
1169 | 1258 | wacom_intuos_bt_process_data(wacom, data + i); |
---|
1170 | 1259 | i += 10; |
---|
.. | .. |
---|
1218 | 1307 | |
---|
1219 | 1308 | struct input_dev *pen_input = wacom->pen_input; |
---|
1220 | 1309 | unsigned char *data = wacom->data; |
---|
| 1310 | + int number_of_valid_frames = 0; |
---|
| 1311 | + ktime_t time_interval = 15000000; |
---|
| 1312 | + ktime_t time_packet_received = ktime_get(); |
---|
1221 | 1313 | int i; |
---|
1222 | 1314 | |
---|
1223 | | - if (wacom->features.type == INTUOSP2_BT) { |
---|
| 1315 | + if (wacom->features.type == INTUOSP2_BT || |
---|
| 1316 | + wacom->features.type == INTUOSP2S_BT) { |
---|
1224 | 1317 | wacom->serial[0] = get_unaligned_le64(&data[99]); |
---|
1225 | 1318 | wacom->id[0] = get_unaligned_le16(&data[107]); |
---|
1226 | 1319 | pen_frame_len = 14; |
---|
.. | .. |
---|
1237 | 1330 | wacom->id[0] |= (wacom->serial[0] >> 32) & 0xFFFFF; |
---|
1238 | 1331 | } |
---|
1239 | 1332 | |
---|
| 1333 | + /* number of valid frames */ |
---|
1240 | 1334 | for (i = 0; i < pen_frames; i++) { |
---|
| 1335 | + unsigned char *frame = &data[i*pen_frame_len + 1]; |
---|
| 1336 | + bool valid = frame[0] & 0x80; |
---|
| 1337 | + |
---|
| 1338 | + if (valid) |
---|
| 1339 | + number_of_valid_frames++; |
---|
| 1340 | + } |
---|
| 1341 | + |
---|
| 1342 | + if (number_of_valid_frames) { |
---|
| 1343 | + if (wacom->hid_data.time_delayed) |
---|
| 1344 | + time_interval = ktime_get() - wacom->hid_data.time_delayed; |
---|
| 1345 | + time_interval = div_u64(time_interval, number_of_valid_frames); |
---|
| 1346 | + wacom->hid_data.time_delayed = time_packet_received; |
---|
| 1347 | + } |
---|
| 1348 | + |
---|
| 1349 | + for (i = 0; i < number_of_valid_frames; i++) { |
---|
1241 | 1350 | unsigned char *frame = &data[i*pen_frame_len + 1]; |
---|
1242 | 1351 | bool valid = frame[0] & 0x80; |
---|
1243 | 1352 | bool prox = frame[0] & 0x40; |
---|
1244 | 1353 | bool range = frame[0] & 0x20; |
---|
1245 | 1354 | bool invert = frame[0] & 0x10; |
---|
| 1355 | + int frames_number_reversed = number_of_valid_frames - i - 1; |
---|
| 1356 | + ktime_t event_timestamp = time_packet_received - frames_number_reversed * time_interval; |
---|
1246 | 1357 | |
---|
1247 | 1358 | if (!valid) |
---|
1248 | 1359 | continue; |
---|
.. | .. |
---|
1255 | 1366 | wacom->tool[0] = 0; |
---|
1256 | 1367 | wacom->id[0] = 0; |
---|
1257 | 1368 | wacom->serial[0] = 0; |
---|
| 1369 | + wacom->hid_data.time_delayed = 0; |
---|
1258 | 1370 | return; |
---|
1259 | 1371 | } |
---|
1260 | 1372 | |
---|
.. | .. |
---|
1272 | 1384 | input_report_abs(pen_input, ABS_X, get_unaligned_le16(&frame[1])); |
---|
1273 | 1385 | input_report_abs(pen_input, ABS_Y, get_unaligned_le16(&frame[3])); |
---|
1274 | 1386 | |
---|
1275 | | - if (wacom->features.type == INTUOSP2_BT) { |
---|
| 1387 | + if (wacom->features.type == INTUOSP2_BT || |
---|
| 1388 | + wacom->features.type == INTUOSP2S_BT) { |
---|
1276 | 1389 | /* Fix rotation alignment: userspace expects zero at left */ |
---|
1277 | 1390 | int16_t rotation = |
---|
1278 | 1391 | (int16_t)get_unaligned_le16(&frame[9]); |
---|
.. | .. |
---|
1293 | 1406 | |
---|
1294 | 1407 | if (wacom->tool[0]) { |
---|
1295 | 1408 | input_report_abs(pen_input, ABS_PRESSURE, get_unaligned_le16(&frame[5])); |
---|
1296 | | - if (wacom->features.type == INTUOSP2_BT) { |
---|
| 1409 | + if (wacom->features.type == INTUOSP2_BT || |
---|
| 1410 | + wacom->features.type == INTUOSP2S_BT) { |
---|
1297 | 1411 | input_report_abs(pen_input, ABS_DISTANCE, |
---|
1298 | 1412 | range ? frame[13] : wacom->features.distance_max); |
---|
1299 | 1413 | } else { |
---|
.. | .. |
---|
1312 | 1426 | } |
---|
1313 | 1427 | |
---|
1314 | 1428 | wacom->shared->stylus_in_proximity = prox; |
---|
| 1429 | + |
---|
| 1430 | + /* add timestamp to unpack the frames */ |
---|
| 1431 | + input_set_timestamp(pen_input, event_timestamp); |
---|
1315 | 1432 | |
---|
1316 | 1433 | input_sync(pen_input); |
---|
1317 | 1434 | } |
---|
.. | .. |
---|
1388 | 1505 | { |
---|
1389 | 1506 | struct input_dev *pad_input = wacom->pad_input; |
---|
1390 | 1507 | unsigned char *data = wacom->data; |
---|
| 1508 | + int nbuttons = wacom->features.numbered_buttons; |
---|
1391 | 1509 | |
---|
1392 | | - int buttons = data[282] | ((data[281] & 0x40) << 2); |
---|
| 1510 | + int expresskeys = data[282]; |
---|
| 1511 | + int center = (data[281] & 0x40) >> 6; |
---|
1393 | 1512 | int ring = data[285] & 0x7F; |
---|
1394 | 1513 | bool ringstatus = data[285] & 0x80; |
---|
1395 | | - bool prox = buttons || ringstatus; |
---|
| 1514 | + bool prox = expresskeys || center || ringstatus; |
---|
1396 | 1515 | |
---|
1397 | 1516 | /* Fix touchring data: userspace expects 0 at left and increasing clockwise */ |
---|
1398 | 1517 | ring = 71 - ring; |
---|
.. | .. |
---|
1400 | 1519 | if (ring > 71) |
---|
1401 | 1520 | ring -= 72; |
---|
1402 | 1521 | |
---|
1403 | | - wacom_report_numbered_buttons(pad_input, 9, buttons); |
---|
| 1522 | + wacom_report_numbered_buttons(pad_input, nbuttons, |
---|
| 1523 | + expresskeys | (center << (nbuttons - 1))); |
---|
1404 | 1524 | |
---|
1405 | 1525 | input_report_abs(pad_input, ABS_WHEEL, ringstatus ? ring : 0); |
---|
1406 | 1526 | |
---|
.. | .. |
---|
1460 | 1580 | } |
---|
1461 | 1581 | |
---|
1462 | 1582 | wacom_intuos_pro2_bt_pen(wacom); |
---|
1463 | | - if (wacom->features.type == INTUOSP2_BT) { |
---|
| 1583 | + if (wacom->features.type == INTUOSP2_BT || |
---|
| 1584 | + wacom->features.type == INTUOSP2S_BT) { |
---|
1464 | 1585 | wacom_intuos_pro2_bt_touch(wacom); |
---|
1465 | 1586 | wacom_intuos_pro2_bt_pad(wacom); |
---|
1466 | 1587 | wacom_intuos_pro2_bt_battery(wacom); |
---|
.. | .. |
---|
1481 | 1602 | int num_contacts_left = 4; /* maximum contacts per packet */ |
---|
1482 | 1603 | int byte_per_packet = WACOM_BYTES_PER_24HDT_PACKET; |
---|
1483 | 1604 | int y_offset = 2; |
---|
| 1605 | + |
---|
| 1606 | + if (wacom->shared->has_mute_touch_switch && |
---|
| 1607 | + !wacom->shared->is_touch_on) { |
---|
| 1608 | + if (!wacom->shared->touch_down) |
---|
| 1609 | + return 0; |
---|
| 1610 | + } |
---|
1484 | 1611 | |
---|
1485 | 1612 | if (wacom->features.type == WACOM_27QHDT) { |
---|
1486 | 1613 | current_num_contacts = data[63]; |
---|
.. | .. |
---|
1772 | 1899 | int subpage = (usage & 0xFF00) << 8; |
---|
1773 | 1900 | int subusage = (usage & 0xFF); |
---|
1774 | 1901 | |
---|
| 1902 | + if (usage == WACOM_HID_WT_REPORT_VALID) |
---|
| 1903 | + return usage; |
---|
| 1904 | + |
---|
1775 | 1905 | if (subpage == HID_UP_UNDEFINED) |
---|
1776 | 1906 | subpage = WACOM_HID_SP_DIGITIZER; |
---|
1777 | 1907 | |
---|
.. | .. |
---|
1791 | 1921 | int fmax = field->logical_maximum; |
---|
1792 | 1922 | unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid); |
---|
1793 | 1923 | int resolution_code = code; |
---|
| 1924 | + int resolution = hidinput_calc_abs_res(field, resolution_code); |
---|
1794 | 1925 | |
---|
1795 | 1926 | if (equivalent_usage == HID_DG_TWIST) { |
---|
1796 | 1927 | resolution_code = ABS_RZ; |
---|
.. | .. |
---|
1813 | 1944 | switch (type) { |
---|
1814 | 1945 | case EV_ABS: |
---|
1815 | 1946 | input_set_abs_params(input, code, fmin, fmax, fuzz, 0); |
---|
1816 | | - input_abs_set_res(input, code, |
---|
1817 | | - hidinput_calc_abs_res(field, resolution_code)); |
---|
| 1947 | + |
---|
| 1948 | + /* older tablet may miss physical usage */ |
---|
| 1949 | + if ((code == ABS_X || code == ABS_Y) && !resolution) { |
---|
| 1950 | + resolution = WACOM_INTUOS_RES; |
---|
| 1951 | + hid_warn(input, |
---|
| 1952 | + "Wacom usage (%d) missing resolution \n", |
---|
| 1953 | + code); |
---|
| 1954 | + } |
---|
| 1955 | + input_abs_set_res(input, code, resolution); |
---|
1818 | 1956 | break; |
---|
1819 | 1957 | case EV_KEY: |
---|
1820 | 1958 | input_set_capability(input, EV_KEY, code); |
---|
.. | .. |
---|
1831 | 1969 | static void wacom_wac_battery_usage_mapping(struct hid_device *hdev, |
---|
1832 | 1970 | struct hid_field *field, struct hid_usage *usage) |
---|
1833 | 1971 | { |
---|
1834 | | - struct wacom *wacom = hid_get_drvdata(hdev); |
---|
1835 | | - struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
---|
1836 | | - struct wacom_features *features = &wacom_wac->features; |
---|
1837 | | - unsigned equivalent_usage = wacom_equivalent_usage(usage->hid); |
---|
1838 | | - |
---|
1839 | | - switch (equivalent_usage) { |
---|
1840 | | - case HID_DG_BATTERYSTRENGTH: |
---|
1841 | | - case WACOM_HID_WD_BATTERY_LEVEL: |
---|
1842 | | - case WACOM_HID_WD_BATTERY_CHARGING: |
---|
1843 | | - features->quirks |= WACOM_QUIRK_BATTERY; |
---|
1844 | | - break; |
---|
1845 | | - } |
---|
| 1972 | + return; |
---|
1846 | 1973 | } |
---|
1847 | 1974 | |
---|
1848 | 1975 | static void wacom_wac_battery_event(struct hid_device *hdev, struct hid_field *field, |
---|
.. | .. |
---|
1863 | 1990 | wacom_wac->hid_data.bat_connected = 1; |
---|
1864 | 1991 | wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; |
---|
1865 | 1992 | } |
---|
| 1993 | + wacom_wac->features.quirks |= WACOM_QUIRK_BATTERY; |
---|
1866 | 1994 | break; |
---|
1867 | 1995 | case WACOM_HID_WD_BATTERY_LEVEL: |
---|
1868 | 1996 | value = value * 100 / (field->logical_maximum - field->logical_minimum); |
---|
1869 | 1997 | wacom_wac->hid_data.battery_capacity = value; |
---|
1870 | 1998 | wacom_wac->hid_data.bat_connected = 1; |
---|
1871 | 1999 | wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; |
---|
| 2000 | + wacom_wac->features.quirks |= WACOM_QUIRK_BATTERY; |
---|
1872 | 2001 | break; |
---|
1873 | 2002 | case WACOM_HID_WD_BATTERY_CHARGING: |
---|
1874 | 2003 | wacom_wac->hid_data.bat_charging = value; |
---|
1875 | 2004 | wacom_wac->hid_data.ps_connected = value; |
---|
1876 | 2005 | wacom_wac->hid_data.bat_connected = 1; |
---|
1877 | 2006 | wacom_wac->hid_data.bat_status = WACOM_POWER_SUPPLY_STATUS_AUTO; |
---|
| 2007 | + wacom_wac->features.quirks |= WACOM_QUIRK_BATTERY; |
---|
1878 | 2008 | break; |
---|
1879 | 2009 | } |
---|
1880 | 2010 | } |
---|
.. | .. |
---|
1890 | 2020 | { |
---|
1891 | 2021 | struct wacom *wacom = hid_get_drvdata(hdev); |
---|
1892 | 2022 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
---|
1893 | | - struct wacom_features *features = &wacom_wac->features; |
---|
1894 | 2023 | |
---|
1895 | | - if (features->quirks & WACOM_QUIRK_BATTERY) { |
---|
1896 | | - int status = wacom_wac->hid_data.bat_status; |
---|
1897 | | - int capacity = wacom_wac->hid_data.battery_capacity; |
---|
1898 | | - bool charging = wacom_wac->hid_data.bat_charging; |
---|
1899 | | - bool connected = wacom_wac->hid_data.bat_connected; |
---|
1900 | | - bool powered = wacom_wac->hid_data.ps_connected; |
---|
| 2024 | + int status = wacom_wac->hid_data.bat_status; |
---|
| 2025 | + int capacity = wacom_wac->hid_data.battery_capacity; |
---|
| 2026 | + bool charging = wacom_wac->hid_data.bat_charging; |
---|
| 2027 | + bool connected = wacom_wac->hid_data.bat_connected; |
---|
| 2028 | + bool powered = wacom_wac->hid_data.ps_connected; |
---|
1901 | 2029 | |
---|
1902 | | - wacom_notify_battery(wacom_wac, status, capacity, charging, |
---|
1903 | | - connected, powered); |
---|
1904 | | - } |
---|
| 2030 | + wacom_notify_battery(wacom_wac, status, capacity, charging, |
---|
| 2031 | + connected, powered); |
---|
1905 | 2032 | } |
---|
1906 | 2033 | |
---|
1907 | 2034 | static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, |
---|
.. | .. |
---|
1954 | 2081 | wacom_wac->has_mute_touch_switch = true; |
---|
1955 | 2082 | usage->type = EV_SW; |
---|
1956 | 2083 | usage->code = SW_MUTE_DEVICE; |
---|
1957 | | - features->device_type |= WACOM_DEVICETYPE_PAD; |
---|
1958 | 2084 | break; |
---|
1959 | 2085 | case WACOM_HID_WD_TOUCHSTRIP: |
---|
1960 | 2086 | wacom_map_usage(input, usage, field, EV_ABS, ABS_RX, 0); |
---|
.. | .. |
---|
2034 | 2160 | wacom_wac->hid_data.inrange_state |= value; |
---|
2035 | 2161 | } |
---|
2036 | 2162 | |
---|
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: |
---|
| 2163 | + /* Process touch switch state first since it is reported through touch interface, |
---|
| 2164 | + * which is indepentent of pad interface. In the case when there are no other pad |
---|
| 2165 | + * events, the pad interface will not even be created. |
---|
| 2166 | + */ |
---|
| 2167 | + if ((equivalent_usage == WACOM_HID_WD_MUTE_DEVICE) || |
---|
| 2168 | + (equivalent_usage == WACOM_HID_WD_TOUCHONOFF)) { |
---|
2068 | 2169 | if (wacom_wac->shared->touch_input) { |
---|
2069 | 2170 | bool *is_touch_on = &wacom_wac->shared->is_touch_on; |
---|
2070 | 2171 | |
---|
.. | .. |
---|
2077 | 2178 | SW_MUTE_DEVICE, !(*is_touch_on)); |
---|
2078 | 2179 | input_sync(wacom_wac->shared->touch_input); |
---|
2079 | 2180 | } |
---|
| 2181 | + return; |
---|
| 2182 | + } |
---|
| 2183 | + |
---|
| 2184 | + if (!input) |
---|
| 2185 | + return; |
---|
| 2186 | + |
---|
| 2187 | + switch (equivalent_usage) { |
---|
| 2188 | + case WACOM_HID_WD_TOUCHRING: |
---|
| 2189 | + /* |
---|
| 2190 | + * Userspace expects touchrings to increase in value with |
---|
| 2191 | + * clockwise gestures and have their zero point at the |
---|
| 2192 | + * tablet's left. HID events "should" be clockwise- |
---|
| 2193 | + * increasing and zero at top, though the MobileStudio |
---|
| 2194 | + * Pro and 2nd-gen Intuos Pro don't do this... |
---|
| 2195 | + */ |
---|
| 2196 | + if (hdev->vendor == 0x56a && |
---|
| 2197 | + (hdev->product == 0x34d || hdev->product == 0x34e || /* MobileStudio Pro */ |
---|
| 2198 | + hdev->product == 0x357 || hdev->product == 0x358 || /* Intuos Pro 2 */ |
---|
| 2199 | + hdev->product == 0x392 || /* Intuos Pro 2 */ |
---|
| 2200 | + hdev->product == 0x398 || hdev->product == 0x399 || /* MobileStudio Pro */ |
---|
| 2201 | + hdev->product == 0x3AA)) { /* MobileStudio Pro */ |
---|
| 2202 | + value = (field->logical_maximum - value); |
---|
| 2203 | + |
---|
| 2204 | + if (hdev->product == 0x357 || hdev->product == 0x358 || |
---|
| 2205 | + hdev->product == 0x392) |
---|
| 2206 | + value = wacom_offset_rotation(input, usage, value, 3, 16); |
---|
| 2207 | + else if (hdev->product == 0x34d || hdev->product == 0x34e || |
---|
| 2208 | + hdev->product == 0x398 || hdev->product == 0x399 || |
---|
| 2209 | + hdev->product == 0x3AA) |
---|
| 2210 | + value = wacom_offset_rotation(input, usage, value, 1, 2); |
---|
| 2211 | + } |
---|
| 2212 | + else { |
---|
| 2213 | + value = wacom_offset_rotation(input, usage, value, 1, 4); |
---|
| 2214 | + } |
---|
| 2215 | + do_report = true; |
---|
| 2216 | + break; |
---|
| 2217 | + case WACOM_HID_WD_TOUCHRINGSTATUS: |
---|
| 2218 | + if (!value) |
---|
| 2219 | + input_event(input, usage->type, usage->code, 0); |
---|
2080 | 2220 | break; |
---|
2081 | 2221 | |
---|
2082 | 2222 | case WACOM_HID_WD_MODE_CHANGE: |
---|
.. | .. |
---|
2090 | 2230 | for (i = 0; i < wacom->led.count; i++) |
---|
2091 | 2231 | wacom_update_led(wacom, features->numbered_buttons, |
---|
2092 | 2232 | value, i); |
---|
2093 | | - /* fall through*/ |
---|
| 2233 | + fallthrough; |
---|
2094 | 2234 | default: |
---|
2095 | 2235 | do_report = true; |
---|
2096 | 2236 | break; |
---|
.. | .. |
---|
2181 | 2321 | case HID_DG_TOOLSERIALNUMBER: |
---|
2182 | 2322 | features->quirks |= WACOM_QUIRK_TOOLSERIAL; |
---|
2183 | 2323 | 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 | | - } |
---|
2205 | 2324 | break; |
---|
2206 | 2325 | case WACOM_HID_WD_SENSE: |
---|
2207 | 2326 | features->quirks |= WACOM_QUIRK_SENSE; |
---|
.. | .. |
---|
2251 | 2370 | value = field->logical_maximum - value; |
---|
2252 | 2371 | break; |
---|
2253 | 2372 | case HID_DG_INRANGE: |
---|
| 2373 | + mod_timer(&wacom->idleprox_timer, jiffies + msecs_to_jiffies(100)); |
---|
2254 | 2374 | wacom_wac->hid_data.inrange_state = value; |
---|
2255 | 2375 | if (!(features->quirks & WACOM_QUIRK_SENSE)) |
---|
2256 | 2376 | wacom_wac->hid_data.sense_state = value; |
---|
.. | .. |
---|
2275 | 2395 | } |
---|
2276 | 2396 | return; |
---|
2277 | 2397 | case HID_DG_TWIST: |
---|
| 2398 | + /* don't modify the value if the pen doesn't support the feature */ |
---|
| 2399 | + if (!wacom_is_art_pen(wacom_wac->id[0])) return; |
---|
| 2400 | + |
---|
2278 | 2401 | /* |
---|
2279 | 2402 | * Userspace expects pen twist to have its zero point when |
---|
2280 | 2403 | * the buttons/finger is on the tablet's left. HID values |
---|
.. | .. |
---|
2555 | 2678 | unsigned equivalent_usage = wacom_equivalent_usage(usage->hid); |
---|
2556 | 2679 | struct wacom_features *features = &wacom->wacom_wac.features; |
---|
2557 | 2680 | |
---|
| 2681 | + if (wacom_wac->is_invalid_bt_frame) |
---|
| 2682 | + return; |
---|
| 2683 | + |
---|
2558 | 2684 | switch (equivalent_usage) { |
---|
2559 | 2685 | case HID_DG_CONFIDENCE: |
---|
2560 | 2686 | wacom_wac->hid_data.confidence = value; |
---|
.. | .. |
---|
2577 | 2703 | case HID_DG_TIPSWITCH: |
---|
2578 | 2704 | wacom_wac->hid_data.tipswitch = value; |
---|
2579 | 2705 | break; |
---|
| 2706 | + case WACOM_HID_WT_REPORT_VALID: |
---|
| 2707 | + wacom_wac->is_invalid_bt_frame = !value; |
---|
| 2708 | + return; |
---|
2580 | 2709 | case HID_DG_CONTACTMAX: |
---|
2581 | 2710 | if (!features->touch_max) { |
---|
2582 | 2711 | features->touch_max = value; |
---|
.. | .. |
---|
2586 | 2715 | } |
---|
2587 | 2716 | return; |
---|
2588 | 2717 | } |
---|
2589 | | - |
---|
2590 | 2718 | |
---|
2591 | 2719 | if (usage->usage_index + 1 == field->report_count) { |
---|
2592 | 2720 | if (equivalent_usage == wacom_wac->hid_data.last_slot_field) { |
---|
.. | .. |
---|
2607 | 2735 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
---|
2608 | 2736 | struct hid_data* hid_data = &wacom_wac->hid_data; |
---|
2609 | 2737 | int i; |
---|
| 2738 | + |
---|
| 2739 | + wacom_wac->is_invalid_bt_frame = false; |
---|
2610 | 2740 | |
---|
2611 | 2741 | hid_data->confidence = true; |
---|
2612 | 2742 | |
---|
.. | .. |
---|
2719 | 2849 | /* usage tests must precede field tests */ |
---|
2720 | 2850 | if (WACOM_BATTERY_USAGE(usage)) |
---|
2721 | 2851 | wacom_wac_battery_event(hdev, field, usage, value); |
---|
2722 | | - else if (WACOM_PAD_FIELD(field) && wacom->wacom_wac.pad_input) |
---|
| 2852 | + else if (WACOM_PAD_FIELD(field)) |
---|
2723 | 2853 | wacom_wac_pad_event(hdev, field, usage, value); |
---|
2724 | 2854 | else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) |
---|
2725 | 2855 | wacom_wac_pen_event(hdev, field, usage, value); |
---|
.. | .. |
---|
3299 | 3429 | break; |
---|
3300 | 3430 | |
---|
3301 | 3431 | case INTUOSP2_BT: |
---|
| 3432 | + case INTUOSP2S_BT: |
---|
3302 | 3433 | case INTUOSHT3_BT: |
---|
3303 | 3434 | sync = wacom_intuos_pro2_bt_irq(wacom_wac, len); |
---|
3304 | 3435 | break; |
---|
.. | .. |
---|
3479 | 3610 | if (features->type == REMOTE) |
---|
3480 | 3611 | features->device_type = WACOM_DEVICETYPE_PAD; |
---|
3481 | 3612 | |
---|
3482 | | - if (features->type == INTUOSP2_BT) { |
---|
| 3613 | + if (features->type == INTUOSP2_BT || |
---|
| 3614 | + features->type == INTUOSP2S_BT) { |
---|
3483 | 3615 | features->device_type |= WACOM_DEVICETYPE_PEN | |
---|
3484 | 3616 | WACOM_DEVICETYPE_PAD | |
---|
3485 | 3617 | WACOM_DEVICETYPE_TOUCH; |
---|
.. | .. |
---|
3599 | 3731 | switch (features->type) { |
---|
3600 | 3732 | case GRAPHIRE_BT: |
---|
3601 | 3733 | __clear_bit(ABS_MISC, input_dev->absbit); |
---|
| 3734 | + fallthrough; |
---|
3602 | 3735 | |
---|
3603 | 3736 | case WACOM_MO: |
---|
3604 | 3737 | case WACOM_G4: |
---|
3605 | 3738 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, |
---|
3606 | 3739 | features->distance_max, |
---|
3607 | 3740 | features->distance_fuzz, 0); |
---|
3608 | | - /* fall through */ |
---|
| 3741 | + fallthrough; |
---|
3609 | 3742 | |
---|
3610 | 3743 | case GRAPHIRE: |
---|
3611 | 3744 | input_set_capability(input_dev, EV_REL, REL_WHEEL); |
---|
.. | .. |
---|
3645 | 3778 | case INTUOS4S: |
---|
3646 | 3779 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
---|
3647 | 3780 | input_abs_set_res(input_dev, ABS_Z, 287); |
---|
3648 | | - /* fall through */ |
---|
| 3781 | + fallthrough; |
---|
3649 | 3782 | |
---|
3650 | 3783 | case INTUOS: |
---|
3651 | 3784 | wacom_setup_intuos(wacom_wac); |
---|
.. | .. |
---|
3658 | 3791 | case INTUOS5S: |
---|
3659 | 3792 | case INTUOSPS: |
---|
3660 | 3793 | case INTUOSP2_BT: |
---|
| 3794 | + case INTUOSP2S_BT: |
---|
3661 | 3795 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, |
---|
3662 | 3796 | features->distance_max, |
---|
3663 | 3797 | features->distance_fuzz, 0); |
---|
.. | .. |
---|
3677 | 3811 | case TABLETPC: |
---|
3678 | 3812 | case TABLETPCE: |
---|
3679 | 3813 | __clear_bit(ABS_MISC, input_dev->absbit); |
---|
3680 | | - /* fall through */ |
---|
| 3814 | + fallthrough; |
---|
3681 | 3815 | |
---|
3682 | 3816 | case DTUS: |
---|
3683 | 3817 | case DTUSX: |
---|
.. | .. |
---|
3691 | 3825 | |
---|
3692 | 3826 | case PTU: |
---|
3693 | 3827 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
---|
3694 | | - /* fall through */ |
---|
| 3828 | + fallthrough; |
---|
3695 | 3829 | |
---|
3696 | 3830 | case PENPARTNER: |
---|
3697 | 3831 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
---|
.. | .. |
---|
3768 | 3902 | |
---|
3769 | 3903 | switch (features->type) { |
---|
3770 | 3904 | case INTUOSP2_BT: |
---|
| 3905 | + case INTUOSP2S_BT: |
---|
3771 | 3906 | input_dev->evbit[0] |= BIT_MASK(EV_SW); |
---|
3772 | 3907 | __set_bit(SW_MUTE_DEVICE, input_dev->swbit); |
---|
3773 | 3908 | |
---|
.. | .. |
---|
3783 | 3918 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, |
---|
3784 | 3919 | 0, 5920, 4, 0); |
---|
3785 | 3920 | } |
---|
| 3921 | + else if (wacom_wac->shared->touch->product == 0x393) { |
---|
| 3922 | + input_set_abs_params(input_dev, ABS_MT_POSITION_X, |
---|
| 3923 | + 0, 6400, 4, 0); |
---|
| 3924 | + input_set_abs_params(input_dev, ABS_MT_POSITION_Y, |
---|
| 3925 | + 0, 4000, 4, 0); |
---|
| 3926 | + } |
---|
3786 | 3927 | input_abs_set_res(input_dev, ABS_MT_POSITION_X, 40); |
---|
3787 | 3928 | input_abs_set_res(input_dev, ABS_MT_POSITION_Y, 40); |
---|
3788 | 3929 | |
---|
3789 | | - /* fall through */ |
---|
| 3930 | + fallthrough; |
---|
3790 | 3931 | |
---|
3791 | 3932 | case INTUOS5: |
---|
3792 | 3933 | case INTUOS5L: |
---|
.. | .. |
---|
3804 | 3945 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, 0, features->x_max, 0, 0); |
---|
3805 | 3946 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MINOR, 0, features->y_max, 0, 0); |
---|
3806 | 3947 | input_set_abs_params(input_dev, ABS_MT_ORIENTATION, 0, 1, 0, 0); |
---|
3807 | | - /* fall through */ |
---|
| 3948 | + fallthrough; |
---|
3808 | 3949 | |
---|
3809 | 3950 | case WACOM_27QHDT: |
---|
| 3951 | + if (wacom_wac->shared->touch->product == 0x32C || |
---|
| 3952 | + wacom_wac->shared->touch->product == 0xF6) { |
---|
| 3953 | + input_dev->evbit[0] |= BIT_MASK(EV_SW); |
---|
| 3954 | + __set_bit(SW_MUTE_DEVICE, input_dev->swbit); |
---|
| 3955 | + wacom_wac->has_mute_touch_switch = true; |
---|
| 3956 | + } |
---|
| 3957 | + fallthrough; |
---|
| 3958 | + |
---|
3810 | 3959 | case MTSCREEN: |
---|
3811 | 3960 | case MTTPC: |
---|
3812 | 3961 | case MTTPC_B: |
---|
3813 | 3962 | case TABLETPC2FG: |
---|
3814 | 3963 | input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_DIRECT); |
---|
3815 | | - /*fall through */ |
---|
| 3964 | + fallthrough; |
---|
3816 | 3965 | |
---|
3817 | 3966 | case TABLETPC: |
---|
3818 | 3967 | case TABLETPCE: |
---|
.. | .. |
---|
3822 | 3971 | case INTUOSHT2: |
---|
3823 | 3972 | input_dev->evbit[0] |= BIT_MASK(EV_SW); |
---|
3824 | 3973 | __set_bit(SW_MUTE_DEVICE, input_dev->swbit); |
---|
3825 | | - /* fall through */ |
---|
| 3974 | + fallthrough; |
---|
3826 | 3975 | |
---|
3827 | 3976 | case BAMBOO_PT: |
---|
3828 | 3977 | case BAMBOO_TOUCH: |
---|
.. | .. |
---|
4042 | 4191 | __set_bit(KEY_PROG2, input_dev->keybit); |
---|
4043 | 4192 | __set_bit(KEY_PROG3, input_dev->keybit); |
---|
4044 | 4193 | |
---|
| 4194 | + __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit); |
---|
| 4195 | + __set_bit(KEY_INFO, input_dev->keybit); |
---|
| 4196 | + |
---|
| 4197 | + if (!features->oPid) |
---|
| 4198 | + __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); |
---|
| 4199 | + |
---|
4045 | 4200 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
---|
4046 | 4201 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); |
---|
4047 | 4202 | break; |
---|
.. | .. |
---|
4050 | 4205 | __set_bit(KEY_PROG1, input_dev->keybit); |
---|
4051 | 4206 | __set_bit(KEY_PROG2, input_dev->keybit); |
---|
4052 | 4207 | __set_bit(KEY_PROG3, input_dev->keybit); |
---|
| 4208 | + |
---|
| 4209 | + __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit); |
---|
| 4210 | + __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); |
---|
| 4211 | + |
---|
| 4212 | + if (!features->oPid) |
---|
| 4213 | + __set_bit(KEY_CONTROLPANEL, input_dev->keybit); |
---|
4053 | 4214 | input_set_abs_params(input_dev, ABS_X, -2048, 2048, 0, 0); |
---|
4054 | 4215 | input_abs_set_res(input_dev, ABS_X, 1024); /* points/g */ |
---|
4055 | 4216 | input_set_abs_params(input_dev, ABS_Y, -2048, 2048, 0, 0); |
---|
.. | .. |
---|
4063 | 4224 | __set_bit(KEY_PROG1, input_dev->keybit); |
---|
4064 | 4225 | __set_bit(KEY_PROG2, input_dev->keybit); |
---|
4065 | 4226 | __set_bit(KEY_PROG3, input_dev->keybit); |
---|
4066 | | - /* fall through */ |
---|
| 4227 | + |
---|
| 4228 | + __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); |
---|
| 4229 | + __set_bit(KEY_INFO, input_dev->keybit); |
---|
| 4230 | + fallthrough; |
---|
4067 | 4231 | |
---|
4068 | 4232 | case WACOM_21UX2: |
---|
4069 | 4233 | case WACOM_BEE: |
---|
.. | .. |
---|
4079 | 4243 | case INTUOS3: |
---|
4080 | 4244 | case INTUOS3L: |
---|
4081 | 4245 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); |
---|
4082 | | - /* fall through */ |
---|
| 4246 | + fallthrough; |
---|
4083 | 4247 | |
---|
4084 | 4248 | case INTUOS3S: |
---|
4085 | 4249 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); |
---|
.. | .. |
---|
4092 | 4256 | case INTUOS5S: |
---|
4093 | 4257 | case INTUOSPS: |
---|
4094 | 4258 | case INTUOSP2_BT: |
---|
| 4259 | + case INTUOSP2S_BT: |
---|
4095 | 4260 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
---|
4096 | 4261 | break; |
---|
4097 | 4262 | |
---|
.. | .. |
---|
4102 | 4267 | * ID_INPUT_TABLET to be set. |
---|
4103 | 4268 | */ |
---|
4104 | 4269 | __set_bit(BTN_STYLUS, input_dev->keybit); |
---|
4105 | | - /* fall through */ |
---|
| 4270 | + fallthrough; |
---|
4106 | 4271 | |
---|
4107 | 4272 | case INTUOS4: |
---|
4108 | 4273 | case INTUOS4L: |
---|
.. | .. |
---|
4669 | 4834 | static const struct wacom_features wacom_features_0x37B = |
---|
4670 | 4835 | { "Wacom One by Wacom M", 21600, 13500, 2047, 63, |
---|
4671 | 4836 | BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
---|
| 4837 | +static const struct wacom_features wacom_features_0x393 = |
---|
| 4838 | + { "Wacom Intuos Pro S", 31920, 19950, 8191, 63, |
---|
| 4839 | + INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, |
---|
| 4840 | + .touch_max = 10 }; |
---|
| 4841 | +static const struct wacom_features wacom_features_0x3c6 = |
---|
| 4842 | + { "Wacom Intuos BT S", 15200, 9500, 4095, 63, |
---|
| 4843 | + INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 }; |
---|
| 4844 | +static const struct wacom_features wacom_features_0x3c8 = |
---|
| 4845 | + { "Wacom Intuos BT M", 21600, 13500, 4095, 63, |
---|
| 4846 | + INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 }; |
---|
| 4847 | +static const struct wacom_features wacom_features_0x3dd = |
---|
| 4848 | + { "Wacom Intuos Pro S", 31920, 19950, 8191, 63, |
---|
| 4849 | + INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, |
---|
| 4850 | + .touch_max = 10 }; |
---|
4672 | 4851 | |
---|
4673 | 4852 | static const struct wacom_features wacom_features_HID_ANY_ID = |
---|
4674 | 4853 | { "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID }; |
---|
| 4854 | + |
---|
| 4855 | +static const struct wacom_features wacom_features_0x94 = |
---|
| 4856 | + { "Wacom Bootloader", .type = BOOTLOADER }; |
---|
4675 | 4857 | |
---|
4676 | 4858 | #define USB_DEVICE_WACOM(prod) \ |
---|
4677 | 4859 | HID_DEVICE(BUS_USB, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\ |
---|
.. | .. |
---|
4746 | 4928 | { USB_DEVICE_WACOM(0x84) }, |
---|
4747 | 4929 | { USB_DEVICE_WACOM(0x90) }, |
---|
4748 | 4930 | { USB_DEVICE_WACOM(0x93) }, |
---|
| 4931 | + { USB_DEVICE_WACOM(0x94) }, |
---|
4749 | 4932 | { USB_DEVICE_WACOM(0x97) }, |
---|
4750 | 4933 | { USB_DEVICE_WACOM(0x9A) }, |
---|
4751 | 4934 | { USB_DEVICE_WACOM(0x9F) }, |
---|
.. | .. |
---|
4841 | 5024 | { BT_DEVICE_WACOM(0x379) }, |
---|
4842 | 5025 | { USB_DEVICE_WACOM(0x37A) }, |
---|
4843 | 5026 | { USB_DEVICE_WACOM(0x37B) }, |
---|
| 5027 | + { BT_DEVICE_WACOM(0x393) }, |
---|
| 5028 | + { BT_DEVICE_WACOM(0x3c6) }, |
---|
| 5029 | + { BT_DEVICE_WACOM(0x3c8) }, |
---|
| 5030 | + { BT_DEVICE_WACOM(0x3dd) }, |
---|
4844 | 5031 | { USB_DEVICE_WACOM(0x4001) }, |
---|
4845 | 5032 | { USB_DEVICE_WACOM(0x4004) }, |
---|
4846 | 5033 | { USB_DEVICE_WACOM(0x5000) }, |
---|