Merge branch 'for-4.0/upstream-fixes' into for-4.1/wacom
authorJiri Kosina <jkosina@suse.cz>
Thu, 2 Apr 2015 12:09:09 +0000 (14:09 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 2 Apr 2015 12:09:09 +0000 (14:09 +0200)
Conflicts:
drivers/hid/wacom_wac.c

Need to fetch the 4.0 fixes to apply 4.1 patches based on top
of those.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1  2 
drivers/hid/wacom_wac.c

index 9406b128a44cbc0bb0a4f2fb22a09a5d3ca70d33,bbe32d66e5000157b4d3670c23350ff3fa1a0104..fa0578ecd7a17f8d26164bd3ae405022507ec746
@@@ -1118,15 -1101,16 +1128,16 @@@ static int wacom_24hdt_irq(struct wacom
                                input_report_abs(input, ABS_MT_WIDTH_MINOR, min(w, h));
                                input_report_abs(input, ABS_MT_ORIENTATION, w > h);
                        }
+                       contact_with_no_pen_down_count++;
                }
        }
 -      input_mt_report_pointer_emulation(input, true);
 +      input_mt_sync_frame(input);
  
        wacom->num_contacts_left -= contacts_to_send;
-       if (wacom->num_contacts_left <= 0)
+       if (wacom->num_contacts_left <= 0) {
                wacom->num_contacts_left = 0;
-       wacom->shared->touch_down = (wacom->num_contacts_left > 0);
+               wacom->shared->touch_down = (contact_with_no_pen_down_count > 0);
+       }
        return 1;
  }
  
@@@ -1169,15 -1156,16 +1183,16 @@@ static int wacom_mt_touch(struct wacom_
                        int y = get_unaligned_le16(&data[offset + x_offset + 9]);
                        input_report_abs(input, ABS_MT_POSITION_X, x);
                        input_report_abs(input, ABS_MT_POSITION_Y, y);
+                       contact_with_no_pen_down_count++;
                }
        }
 -      input_mt_report_pointer_emulation(input, true);
 +      input_mt_sync_frame(input);
  
        wacom->num_contacts_left -= contacts_to_send;
-       if (wacom->num_contacts_left < 0)
+       if (wacom->num_contacts_left <= 0) {
                wacom->num_contacts_left = 0;
-       wacom->shared->touch_down = (wacom->num_contacts_left > 0);
+               wacom->shared->touch_down = (contact_with_no_pen_down_count > 0);
+       }
        return 1;
  }
  
@@@ -1755,7 -1747,8 +1774,8 @@@ static int wacom_bpt3_touch(struct waco
                        wacom_bpt3_button_msg(wacom, data + offset);
  
        }
 -      input_mt_report_pointer_emulation(input, true);
 +      input_mt_sync_frame(input);
+       wacom->shared->touch_down = (contact_with_no_pen_down_count > 0);
  
        return 1;
  }
@@@ -1767,9 -1760,23 +1787,12 @@@ static int wacom_bpt_pen(struct wacom_w
        unsigned char *data = wacom->data;
        int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
  
 -      if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_USB)
 +      if (data[0] != WACOM_REPORT_PENABLED)
            return 0;
  
 -      if (data[0] == WACOM_REPORT_USB) {
 -              if (features->type == INTUOSHT &&
 -                  wacom->shared->touch_input &&
 -                  features->touch_max) {
 -                      input_report_switch(wacom->shared->touch_input,
 -                                          SW_MUTE_DEVICE, data[8] & 0x40);
 -                      input_sync(wacom->shared->touch_input);
 -              }
 -              return 0;
 -      }
 -
+       if (wacom->shared->touch_down)
+               return 0;
        prox = (data[1] & 0x20) == 0x20;
  
        /*