From: Jiri Kosina Date: Thu, 2 Apr 2015 12:09:09 +0000 (+0200) Subject: Merge branch 'for-4.0/upstream-fixes' into for-4.1/wacom X-Git-Tag: firefly_0821_release~176^2~1996^2~1^11~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1fd29be5cede285e673d3ed73d9ed9db59536b33;p=firefly-linux-kernel-4.4.55.git Merge branch 'for-4.0/upstream-fixes' into for-4.1/wacom 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 --- 1fd29be5cede285e673d3ed73d9ed9db59536b33 diff --cc drivers/hid/wacom_wac.c index 9406b128a44c,bbe32d66e500..fa0578ecd7a1 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@@ -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; /*