519
519
input_report_key(input, wacom->tool[1], 0);
520
520
input_report_abs(input, ABS_MISC, 0);
522
} else if (features->type == WACOM_24HD) {
523
input_report_key(input, BTN_0, (data[6] & 0x01));
524
input_report_key(input, BTN_1, (data[6] & 0x02));
525
input_report_key(input, BTN_2, (data[6] & 0x04));
526
input_report_key(input, BTN_3, (data[6] & 0x08));
527
input_report_key(input, BTN_4, (data[6] & 0x10));
528
input_report_key(input, BTN_5, (data[6] & 0x20));
529
input_report_key(input, BTN_6, (data[6] & 0x40));
530
input_report_key(input, BTN_7, (data[6] & 0x80));
531
input_report_key(input, BTN_8, (data[8] & 0x01));
532
input_report_key(input, BTN_9, (data[8] & 0x02));
533
input_report_key(input, BTN_A, (data[8] & 0x04));
534
input_report_key(input, BTN_B, (data[8] & 0x08));
535
input_report_key(input, BTN_C, (data[8] & 0x10));
536
input_report_key(input, BTN_X, (data[8] & 0x20));
537
input_report_key(input, BTN_Y, (data[8] & 0x40));
538
input_report_key(input, BTN_Z, (data[8] & 0x80));
541
* Three "buttons" are available on the 24HD which are
542
* physically implemented as a touchstrip. Each button
543
* is approximately 3 bits wide with a 2 bit spacing.
544
* The raw touchstrip bits are stored at:
545
* ((data[3] & 0x1f) << 8) | data[4])
547
input_report_key(input, KEY_PROG1, data[4] & 0x07);
548
input_report_key(input, KEY_PROG2, data[4] & 0xE0);
549
input_report_key(input, KEY_PROG3, data[3] & 0x1C);
551
if (data[1] & 0x80) {
552
input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f));
554
/* Out of proximity, clear wheel value. */
555
input_report_abs(input, ABS_WHEEL, 0);
558
if (data[2] & 0x80) {
559
input_report_abs(input, ABS_THROTTLE, (data[2] & 0x7f));
561
/* Out of proximity, clear second wheel value. */
562
input_report_abs(input, ABS_THROTTLE, 0);
565
if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) {
566
input_report_key(input, wacom->tool[1], 1);
567
input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
569
input_report_key(input, wacom->tool[1], 0);
570
input_report_abs(input, ABS_MISC, 0);
523
573
if (features->type == WACOM_21UX2) {
524
574
input_report_key(input, BTN_0, (data[5] & 0x01));
893
static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
895
struct input_dev *input = wacom->input;
896
int slot_id = data[0] - 2; /* data[0] is between 2 and 17 */
897
bool touch = data[1] & 0x80;
899
touch = touch && !wacom->shared->stylus_in_proximity;
901
input_mt_slot(input, slot_id);
902
input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
905
int x = (data[2] << 4) | (data[4] >> 4);
906
int y = (data[3] << 4) | (data[4] & 0x0f);
909
input_report_abs(input, ABS_MT_POSITION_X, x);
910
input_report_abs(input, ABS_MT_POSITION_Y, y);
911
input_report_abs(input, ABS_MT_TOUCH_MAJOR, w);
915
static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data)
917
struct input_dev *input = wacom->input;
919
input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
920
input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
921
input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
922
input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
925
static int wacom_bpt3_touch(struct wacom_wac *wacom)
927
struct input_dev *input = wacom->input;
928
unsigned char *data = wacom->data;
929
int count = data[1] & 0x07;
935
/* data has up to 7 fixed sized 8-byte messages starting at data[2] */
936
for (i = 0; i < count; i++) {
937
int offset = (8 * i) + 2;
938
int msg_id = data[offset];
940
if (msg_id >= 2 && msg_id <= 17)
941
wacom_bpt3_touch_msg(wacom, data + offset);
942
else if (msg_id == 128)
943
wacom_bpt3_button_msg(wacom, data + offset);
947
input_mt_report_pointer_emulation(input, true);
840
954
static int wacom_bpt_pen(struct wacom_wac *wacom)
842
956
struct input_dev *input = wacom->input;
843
957
unsigned char *data = wacom->data;
844
958
int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
847
* Similar to Graphire protocol, data[1] & 0x20 is proximity and
848
* data[1] & 0x18 is tool ID. 0x30 is safety check to ignore
849
* 2 unused tool ID's.
851
prox = (data[1] & 0x30) == 0x30;
963
prox = (data[1] & 0x20) == 0x20;
854
966
* All reports shared between PEN and RUBBER tool must be
1110
1225
__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1229
__set_bit(BTN_A, input_dev->keybit);
1230
__set_bit(BTN_B, input_dev->keybit);
1231
__set_bit(BTN_C, input_dev->keybit);
1232
__set_bit(BTN_X, input_dev->keybit);
1233
__set_bit(BTN_Y, input_dev->keybit);
1234
__set_bit(BTN_Z, input_dev->keybit);
1236
for (i = 0; i < 10; i++)
1237
__set_bit(BTN_0 + i, input_dev->keybit);
1239
__set_bit(KEY_PROG1, input_dev->keybit);
1240
__set_bit(KEY_PROG2, input_dev->keybit);
1241
__set_bit(KEY_PROG3, input_dev->keybit);
1243
input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1244
input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1245
wacom_setup_cintiq(wacom_wac);
1113
1248
case WACOM_21UX2:
1114
1249
__set_bit(BTN_A, input_dev->keybit);
1115
1250
__set_bit(BTN_B, input_dev->keybit);
1240
1375
__set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1241
1376
__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
1243
input_mt_init_slots(input_dev, 2);
1378
if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
1379
__set_bit(BTN_TOOL_TRIPLETAP,
1381
__set_bit(BTN_TOOL_QUADTAP,
1384
input_mt_init_slots(input_dev, 16);
1386
input_set_abs_params(input_dev,
1390
input_mt_init_slots(input_dev, 2);
1244
1393
input_set_abs_params(input_dev, ABS_MT_POSITION_X,
1245
1394
0, features->x_max,
1246
1395
features->x_fuzz, 0);
1425
1574
static const struct wacom_features wacom_features_0xBC =
1426
1575
{ "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047,
1427
1576
63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1577
static const struct wacom_features wacom_features_0xF4 =
1578
{ "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047,
1579
63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1428
1580
static const struct wacom_features wacom_features_0x3F =
1429
1581
{ "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,
1430
1582
63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1509
1661
static struct wacom_features wacom_features_0xDB =
1510
1662
{ "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
1511
1663
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1664
static const struct wacom_features wacom_features_0xDD =
1665
{ "Wacom Bamboo Connect", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023,
1666
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1667
static const struct wacom_features wacom_features_0xDE =
1668
{ "Wacom Bamboo 16FG 4x5", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023,
1669
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1670
static const struct wacom_features wacom_features_0xDF =
1671
{ "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023,
1672
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1512
1673
static const struct wacom_features wacom_features_0x6004 =
1513
1674
{ "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
1514
1675
0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1604
1765
{ USB_DEVICE_WACOM(0xD8) },
1605
1766
{ USB_DEVICE_WACOM(0xDA) },
1606
1767
{ USB_DEVICE_WACOM(0xDB) },
1768
{ USB_DEVICE_WACOM(0xDD) },
1769
{ USB_DEVICE_WACOM(0xDE) },
1770
{ USB_DEVICE_WACOM(0xDF) },
1607
1771
{ USB_DEVICE_WACOM(0xF0) },
1608
1772
{ USB_DEVICE_WACOM(0xCC) },
1609
1773
{ USB_DEVICE_WACOM(0x90) },