@@ -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 ) |
@@ -580,6 +607,18 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
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
@@ -1480,6 +1519,12 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom)
1480
1519
int byte_per_packet = WACOM_BYTES_PER_24HDT_PACKET ;
1481
1520
int y_offset = 2 ;
1482
1521
1522
+ if (wacom -> shared -> has_mute_touch_switch &&
1523
+ !wacom -> shared -> is_touch_on ) {
1524
+ if (!wacom -> shared -> touch_down )
1525
+ return 0 ;
1526
+ }
1527
+
1483
1528
if (wacom -> features .type == WACOM_27QHDT ) {
1484
1529
current_num_contacts = data [63 ];
1485
1530
num_contacts_left = 10 ;
@@ -3812,6 +3857,14 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
3812
3857
/* fall through */
3813
3858
3814
3859
case WACOM_27QHDT :
3860
+ if (wacom_wac -> shared -> touch -> product == 0x32C ||
3861
+ wacom_wac -> shared -> touch -> product == 0xF6 ) {
3862
+ input_dev -> evbit [0 ] |= BIT_MASK (EV_SW );
3863
+ __set_bit (SW_MUTE_DEVICE , input_dev -> swbit );
3864
+ wacom_wac -> shared -> has_mute_touch_switch = true;
3865
+ }
3866
+ /* fall through */
3867
+
3815
3868
case MTSCREEN :
3816
3869
case MTTPC :
3817
3870
case MTTPC_B :
@@ -4047,6 +4100,12 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
4047
4100
__set_bit (KEY_PROG2 , input_dev -> keybit );
4048
4101
__set_bit (KEY_PROG3 , input_dev -> keybit );
4049
4102
4103
+ __set_bit (KEY_ONSCREEN_KEYBOARD , input_dev -> keybit );
4104
+ __set_bit (KEY_INFO , input_dev -> keybit );
4105
+
4106
+ if (!features -> oPid )
4107
+ __set_bit (KEY_BUTTONCONFIG , input_dev -> keybit );
4108
+
4050
4109
input_set_abs_params (input_dev , ABS_WHEEL , 0 , 71 , 0 , 0 );
4051
4110
input_set_abs_params (input_dev , ABS_THROTTLE , 0 , 71 , 0 , 0 );
4052
4111
break ;
@@ -4055,6 +4114,12 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
4055
4114
__set_bit (KEY_PROG1 , input_dev -> keybit );
4056
4115
__set_bit (KEY_PROG2 , input_dev -> keybit );
4057
4116
__set_bit (KEY_PROG3 , input_dev -> keybit );
4117
+
4118
+ __set_bit (KEY_ONSCREEN_KEYBOARD , input_dev -> keybit );
4119
+ __set_bit (KEY_BUTTONCONFIG , input_dev -> keybit );
4120
+
4121
+ if (!features -> oPid )
4122
+ __set_bit (KEY_CONTROLPANEL , input_dev -> keybit );
4058
4123
input_set_abs_params (input_dev , ABS_X , -2048 , 2048 , 0 , 0 );
4059
4124
input_abs_set_res (input_dev , ABS_X , 1024 ); /* points/g */
4060
4125
input_set_abs_params (input_dev , ABS_Y , -2048 , 2048 , 0 , 0 );
@@ -4068,6 +4133,9 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
4068
4133
__set_bit (KEY_PROG1 , input_dev -> keybit );
4069
4134
__set_bit (KEY_PROG2 , input_dev -> keybit );
4070
4135
__set_bit (KEY_PROG3 , input_dev -> keybit );
4136
+
4137
+ __set_bit (KEY_BUTTONCONFIG , input_dev -> keybit );
4138
+ __set_bit (KEY_INFO , input_dev -> keybit );
4071
4139
/* fall through */
4072
4140
4073
4141
case WACOM_21UX2 :
0 commit comments