@@ -251,7 +251,7 @@ static int wacom_dtu_irq(struct wacom_wac *wacom)
251251
252252static int wacom_dtus_irq (struct wacom_wac * wacom )
253253{
254- char * data = wacom -> data ;
254+ unsigned char * data = wacom -> data ;
255255 struct input_dev * input = wacom -> pen_input ;
256256 unsigned short prox , pressure = 0 ;
257257
@@ -483,6 +483,8 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
483483 int ring1 = 0 , ring2 = 0 ;
484484 int strip1 = 0 , strip2 = 0 ;
485485 bool prox = false;
486+ bool wrench = false, keyboard = false, mute_touch = false, menu = false,
487+ info = false;
486488
487489 /* pad packets. Works as a second tool and is always in prox */
488490 if (!(data [0 ] == WACOM_REPORT_INTUOSPAD || data [0 ] == WACOM_REPORT_INTUOS5PAD ||
@@ -512,10 +514,32 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
512514 keys = ((data [3 ] & 0x1C ) ? 1 <<2 : 0 ) |
513515 ((data [4 ] & 0xE0 ) ? 1 <<1 : 0 ) |
514516 ((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+ }
515528 } else if (features -> type == WACOM_27QHD ) {
516529 nkeys = 3 ;
517530 keys = data [2 ] & 0x07 ;
518531
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+ }
519543 input_report_abs (input , ABS_X , be16_to_cpup ((__be16 * )& data [4 ]));
520544 input_report_abs (input , ABS_Y , be16_to_cpup ((__be16 * )& data [6 ]));
521545 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)
561585 if (features -> type == WACOM_22HD ) {
562586 nkeys = 3 ;
563587 keys = data [9 ] & 0x07 ;
588+
589+ info = !!(data [9 ] & 0x01 );
590+ wrench = !!(data [9 ] & 0x02 );
564591 }
565592 } else {
566593 buttons = ((data [6 ] & 0x10 ) << 5 ) |
@@ -572,14 +599,26 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
572599 strip2 = ((data [3 ] & 0x1f ) << 8 ) | data [4 ];
573600 }
574601
575- prox = (buttons & ~(~0 << nbuttons )) | (keys & ~(~0 << nkeys )) |
602+ prox = (buttons & ~(~0U << nbuttons )) | (keys & ~(~0U << nkeys )) |
576603 (ring1 & 0x80 ) | (ring2 & 0x80 ) | strip1 | strip2 ;
577604
578605 wacom_report_numbered_buttons (input , nbuttons , buttons );
579606
580607 for (i = 0 ; i < nkeys ; i ++ )
581608 input_report_key (input , KEY_PROG1 + i , keys & (1 << i ));
582609
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+
583622 input_report_abs (input , ABS_RX , strip1 );
584623 input_report_abs (input , ABS_RY , strip2 );
585624
@@ -1483,6 +1522,12 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom)
14831522 int byte_per_packet = WACOM_BYTES_PER_24HDT_PACKET ;
14841523 int y_offset = 2 ;
14851524
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+
14861531 if (wacom -> features .type == WACOM_27QHDT ) {
14871532 current_num_contacts = data [63 ];
14881533 num_contacts_left = 10 ;
@@ -2051,14 +2096,14 @@ static void wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field
20512096 (hdev -> product == 0x34d || hdev -> product == 0x34e || /* MobileStudio Pro */
20522097 hdev -> product == 0x357 || hdev -> product == 0x358 || /* Intuos Pro 2 */
20532098 hdev -> product == 0x392 || /* Intuos Pro 2 */
2054- hdev -> product == 0x399 )) { /* MobileStudio Pro */
2099+ hdev -> product == 0x398 || hdev -> product == 0x399 )) { /* MobileStudio Pro */
20552100 value = (field -> logical_maximum - value );
20562101
20572102 if (hdev -> product == 0x357 || hdev -> product == 0x358 ||
20582103 hdev -> product == 0x392 )
20592104 value = wacom_offset_rotation (input , usage , value , 3 , 16 );
20602105 else if (hdev -> product == 0x34d || hdev -> product == 0x34e ||
2061- hdev -> product == 0x399 )
2106+ hdev -> product == 0x398 || hdev -> product == 0x399 )
20622107 value = wacom_offset_rotation (input , usage , value , 1 , 2 );
20632108 }
20642109 else {
@@ -3815,6 +3860,14 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
38153860 /* fall through */
38163861
38173862 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+
38183871 case MTSCREEN :
38193872 case MTTPC :
38203873 case MTTPC_B :
@@ -4050,6 +4103,12 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
40504103 __set_bit (KEY_PROG2 , input_dev -> keybit );
40514104 __set_bit (KEY_PROG3 , input_dev -> keybit );
40524105
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+
40534112 input_set_abs_params (input_dev , ABS_WHEEL , 0 , 71 , 0 , 0 );
40544113 input_set_abs_params (input_dev , ABS_THROTTLE , 0 , 71 , 0 , 0 );
40554114 break ;
@@ -4058,6 +4117,12 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
40584117 __set_bit (KEY_PROG1 , input_dev -> keybit );
40594118 __set_bit (KEY_PROG2 , input_dev -> keybit );
40604119 __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 );
40614126 input_set_abs_params (input_dev , ABS_X , -2048 , 2048 , 0 , 0 );
40624127 input_abs_set_res (input_dev , ABS_X , 1024 ); /* points/g */
40634128 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,
40714136 __set_bit (KEY_PROG1 , input_dev -> keybit );
40724137 __set_bit (KEY_PROG2 , input_dev -> keybit );
40734138 __set_bit (KEY_PROG3 , input_dev -> keybit );
4139+
4140+ __set_bit (KEY_BUTTONCONFIG , input_dev -> keybit );
4141+ __set_bit (KEY_INFO , input_dev -> keybit );
40744142 /* fall through */
40754143
40764144 case WACOM_21UX2 :
0 commit comments