@@ -824,6 +824,13 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
824
824
return 0 ;
825
825
}
826
826
827
+ static inline bool touch_is_muted (struct wacom_wac * wacom_wac )
828
+ {
829
+ return wacom_wac -> probe_complete &&
830
+ wacom_wac -> shared -> has_mute_touch_switch &&
831
+ !wacom_wac -> shared -> is_touch_on ;
832
+ }
833
+
827
834
static inline bool report_touch_events (struct wacom_wac * wacom )
828
835
{
829
836
return (touch_arbitration ? !wacom -> shared -> stylus_in_proximity : 1 );
@@ -1525,11 +1532,8 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom)
1525
1532
int byte_per_packet = WACOM_BYTES_PER_24HDT_PACKET ;
1526
1533
int y_offset = 2 ;
1527
1534
1528
- if (wacom -> shared -> has_mute_touch_switch &&
1529
- !wacom -> shared -> is_touch_on ) {
1530
- if (!wacom -> shared -> touch_down )
1531
- return 0 ;
1532
- }
1535
+ if (touch_is_muted (wacom ) && !wacom -> shared -> touch_down )
1536
+ return 0 ;
1533
1537
1534
1538
if (wacom -> features .type == WACOM_27QHDT ) {
1535
1539
current_num_contacts = data [63 ];
@@ -2536,8 +2540,7 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac,
2536
2540
bool prox = hid_data -> tipswitch &&
2537
2541
report_touch_events (wacom_wac );
2538
2542
2539
- if (wacom_wac -> shared -> has_mute_touch_switch &&
2540
- !wacom_wac -> shared -> is_touch_on ) {
2543
+ if (touch_is_muted (wacom_wac )) {
2541
2544
if (!wacom_wac -> shared -> touch_down )
2542
2545
return ;
2543
2546
prox = false;
@@ -2593,10 +2596,7 @@ static void wacom_wac_finger_event(struct hid_device *hdev,
2593
2596
unsigned equivalent_usage = wacom_equivalent_usage (usage -> hid );
2594
2597
struct wacom_features * features = & wacom -> wacom_wac .features ;
2595
2598
2596
- /* don't process touch events when touch is off */
2597
- if (wacom_wac -> probe_complete &&
2598
- !wacom_wac -> shared -> is_touch_on &&
2599
- !wacom_wac -> shared -> touch_down )
2599
+ if (touch_is_muted (wacom_wac ) && !wacom_wac -> shared -> touch_down )
2600
2600
return ;
2601
2601
2602
2602
if (wacom_wac -> is_invalid_bt_frame )
@@ -2648,10 +2648,7 @@ static void wacom_wac_finger_pre_report(struct hid_device *hdev,
2648
2648
struct hid_data * hid_data = & wacom_wac -> hid_data ;
2649
2649
int i ;
2650
2650
2651
- /* don't process touch events when touch is off */
2652
- if (wacom_wac -> probe_complete &&
2653
- !wacom_wac -> shared -> is_touch_on &&
2654
- !wacom_wac -> shared -> touch_down )
2651
+ if (touch_is_muted (wacom_wac ) && !wacom_wac -> shared -> touch_down )
2655
2652
return ;
2656
2653
2657
2654
wacom_wac -> is_invalid_bt_frame = false;
0 commit comments