@@ -251,7 +251,7 @@ static int wacom_dtu_irq(struct wacom_wac *wacom)
251
251
252
252
static int wacom_dtus_irq (struct wacom_wac * wacom )
253
253
{
254
- char * data = wacom -> data ;
254
+ unsigned char * data = wacom -> data ;
255
255
struct input_dev * input = wacom -> pen_input ;
256
256
unsigned short prox , pressure = 0 ;
257
257
@@ -483,6 +483,8 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
483
483
int ring1 = 0 , ring2 = 0 ;
484
484
int strip1 = 0 , strip2 = 0 ;
485
485
bool prox = false;
486
+ bool wrench = false, keyboard = false, mute_touch = false, menu = false,
487
+ info = false;
486
488
487
489
/* pad packets. Works as a second tool and is always in prox */
488
490
if (!(data [0 ] == WACOM_REPORT_INTUOSPAD || data [0 ] == WACOM_REPORT_INTUOS5PAD ||
@@ -512,10 +514,32 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
512
514
keys = ((data [3 ] & 0x1C ) ? 1 <<2 : 0 ) |
513
515
((data [4 ] & 0xE0 ) ? 1 <<1 : 0 ) |
514
516
((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
+ }
515
528
} else if (features -> type == WACOM_27QHD ) {
516
529
nkeys = 3 ;
517
530
keys = data [2 ] & 0x07 ;
518
531
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
+ }
519
543
input_report_abs (input , ABS_X , be16_to_cpup ((__be16 * )& data [4 ]));
520
544
input_report_abs (input , ABS_Y , be16_to_cpup ((__be16 * )& data [6 ]));
521
545
input_report_abs (input , ABS_Z , be16_to_cpup ((__be16 * )& data [8 ]));
@@ -561,6 +585,9 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
561
585
if (features -> type == WACOM_22HD ) {
562
586
nkeys = 3 ;
563
587
keys = data [9 ] & 0x07 ;
588
+
589
+ info = !!(data [9 ] & 0x01 );
590
+ wrench = !!(data [9 ] & 0x02 );
564
591
}
565
592
} else {
566
593
buttons = ((data [6 ] & 0x10 ) << 5 ) |
@@ -572,14 +599,26 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
572
599
strip2 = ((data [3 ] & 0x1f ) << 8 ) | data [4 ];
573
600
}
574
601
575
- prox = (buttons & ~(~0 << nbuttons )) | (keys & ~(~0 << nkeys )) |
602
+ prox = (buttons & ~(~0U << nbuttons )) | (keys & ~(~0U << nkeys )) |
576
603
(ring1 & 0x80 ) | (ring2 & 0x80 ) | strip1 | strip2 ;
577
604
578
605
wacom_report_numbered_buttons (input , nbuttons , buttons );
579
606
580
607
for (i = 0 ; i < nkeys ; i ++ )
581
608
input_report_key (input , KEY_PROG1 + i , keys & (1 << i ));
582
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
+ }
621
+
583
622
input_report_abs (input , ABS_RX , strip1 );
584
623
input_report_abs (input , ABS_RY , strip2 );
585
624
@@ -1483,6 +1522,12 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom)
1483
1522
int byte_per_packet = WACOM_BYTES_PER_24HDT_PACKET ;
1484
1523
int y_offset = 2 ;
1485
1524
1525
+ if (wacom -> shared -> has_mute_touch_switch &&
1526
+ !wacom -> shared -> is_touch_on ) {
1527
+ if (!wacom -> shared -> touch_down )
1528
+ return 0 ;
1529
+ }
1530
+
1486
1531
if (wacom -> features .type == WACOM_27QHDT ) {
1487
1532
current_num_contacts = data [63 ];
1488
1533
num_contacts_left = 10 ;
@@ -2051,14 +2096,14 @@ static void wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field
2051
2096
(hdev -> product == 0x34d || hdev -> product == 0x34e || /* MobileStudio Pro */
2052
2097
hdev -> product == 0x357 || hdev -> product == 0x358 || /* Intuos Pro 2 */
2053
2098
hdev -> product == 0x392 || /* Intuos Pro 2 */
2054
- hdev -> product == 0x399 )) { /* MobileStudio Pro */
2099
+ hdev -> product == 0x398 || hdev -> product == 0x399 )) { /* MobileStudio Pro */
2055
2100
value = (field -> logical_maximum - value );
2056
2101
2057
2102
if (hdev -> product == 0x357 || hdev -> product == 0x358 ||
2058
2103
hdev -> product == 0x392 )
2059
2104
value = wacom_offset_rotation (input , usage , value , 3 , 16 );
2060
2105
else if (hdev -> product == 0x34d || hdev -> product == 0x34e ||
2061
- hdev -> product == 0x399 )
2106
+ hdev -> product == 0x398 || hdev -> product == 0x399 )
2062
2107
value = wacom_offset_rotation (input , usage , value , 1 , 2 );
2063
2108
}
2064
2109
else {
@@ -3815,6 +3860,14 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
3815
3860
/* fall through */
3816
3861
3817
3862
case WACOM_27QHDT :
3863
+ if (wacom_wac -> shared -> touch -> product == 0x32C ||
3864
+ wacom_wac -> shared -> touch -> product == 0xF6 ) {
3865
+ input_dev -> evbit [0 ] |= BIT_MASK (EV_SW );
3866
+ __set_bit (SW_MUTE_DEVICE , input_dev -> swbit );
3867
+ wacom_wac -> shared -> has_mute_touch_switch = true;
3868
+ }
3869
+ /* fall through */
3870
+
3818
3871
case MTSCREEN :
3819
3872
case MTTPC :
3820
3873
case MTTPC_B :
@@ -4050,6 +4103,12 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
4050
4103
__set_bit (KEY_PROG2 , input_dev -> keybit );
4051
4104
__set_bit (KEY_PROG3 , input_dev -> keybit );
4052
4105
4106
+ __set_bit (KEY_ONSCREEN_KEYBOARD , input_dev -> keybit );
4107
+ __set_bit (KEY_INFO , input_dev -> keybit );
4108
+
4109
+ if (!features -> oPid )
4110
+ __set_bit (KEY_BUTTONCONFIG , input_dev -> keybit );
4111
+
4053
4112
input_set_abs_params (input_dev , ABS_WHEEL , 0 , 71 , 0 , 0 );
4054
4113
input_set_abs_params (input_dev , ABS_THROTTLE , 0 , 71 , 0 , 0 );
4055
4114
break ;
@@ -4058,6 +4117,12 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
4058
4117
__set_bit (KEY_PROG1 , input_dev -> keybit );
4059
4118
__set_bit (KEY_PROG2 , input_dev -> keybit );
4060
4119
__set_bit (KEY_PROG3 , input_dev -> keybit );
4120
+
4121
+ __set_bit (KEY_ONSCREEN_KEYBOARD , input_dev -> keybit );
4122
+ __set_bit (KEY_BUTTONCONFIG , input_dev -> keybit );
4123
+
4124
+ if (!features -> oPid )
4125
+ __set_bit (KEY_CONTROLPANEL , input_dev -> keybit );
4061
4126
input_set_abs_params (input_dev , ABS_X , -2048 , 2048 , 0 , 0 );
4062
4127
input_abs_set_res (input_dev , ABS_X , 1024 ); /* points/g */
4063
4128
input_set_abs_params (input_dev , ABS_Y , -2048 , 2048 , 0 , 0 );
@@ -4071,6 +4136,9 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
4071
4136
__set_bit (KEY_PROG1 , input_dev -> keybit );
4072
4137
__set_bit (KEY_PROG2 , input_dev -> keybit );
4073
4138
__set_bit (KEY_PROG3 , input_dev -> keybit );
4139
+
4140
+ __set_bit (KEY_BUTTONCONFIG , input_dev -> keybit );
4141
+ __set_bit (KEY_INFO , input_dev -> keybit );
4074
4142
/* fall through */
4075
4143
4076
4144
case WACOM_21UX2 :
0 commit comments