From patchwork Fri Jul 15 21:00:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9232751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9F62160865 for ; Fri, 15 Jul 2016 21:05:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92E2426AE3 for ; Fri, 15 Jul 2016 21:05:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 872E22715B; Fri, 15 Jul 2016 21:05:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30F3026AE3 for ; Fri, 15 Jul 2016 21:05:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbcGOVFf (ORCPT ); Fri, 15 Jul 2016 17:05:35 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34022 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303AbcGOVFe (ORCPT ); Fri, 15 Jul 2016 17:05:34 -0400 Received: by mail-pf0-f195.google.com with SMTP id g202so7011185pfb.1 for ; Fri, 15 Jul 2016 14:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=K3EflUvZIf+EyDgqRvRnRlD6j1ffnwOgwEfW8HzX3tY=; b=KFjzoCvJGtCB0C3VEJ1kp8cNgvP+OI89MYR/y2IYwzzUaGB3gb3gQsdlv/cQkhXOOg 4ra7c/tDKjCUo09VZFIO6p/cdM5thBq5bt8a0beWhcjU62qmjssjXNt+nrDIxdB8oBTx Yht8NqC45/KxMlpiSJHnODHWI45HRCyfLGEaTBxKp+2XeSqkC+ucZNrRaPXth8+fN3SS lyFqlsHU/t69FRMCgLyc8tjB4dtvvxXGgmAbvAeUb95CdxLcn6YyswrfqIFEHwOpXx3v SJIfNZgDZnQ98s41Yi/P9mpH+hd7S64dK/fCnsJ6+e8XeswvnJFIUbvdo7/aAoD4xRrc ucMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=K3EflUvZIf+EyDgqRvRnRlD6j1ffnwOgwEfW8HzX3tY=; b=hEvz33wfcv/75uu0lXgoscPj/vkBzglIZrqnfR531R6kqjpRzaGHXw7xRrthfJA8HL jebWrYYKQiY/ggmHr6QH7sOj+tLYuuvsHSQ2esj/rHZlIBIAjL/OW9F/hze/wXvaazc/ bwNe8rtchevxa2Hcaahw3eLZZSX7vm/ZQR+14Viny0rzvs1BHWtyCcbMYAKodo10KloJ FlmAME4WmpYZaA3KiU8gSUCATggfmEHgk3vox/pcxm7zyQi6NDkwvKU3/BQ2OI2cdG4F c95H3Y8xNdYS/25NqZvRusoISWd6o8jgA8P+zG6kBjSjzpLUqylyNspMJwGRMyYPODi4 Du+w== X-Gm-Message-State: ALyK8tI6UMCvl3tNzuH8mpFsfGsnUwPa/qyx10KHIU/IDLQxpDQmyN6r3K1B/Zi3z2FrWQ== X-Received: by 10.98.74.91 with SMTP id x88mr24784594pfa.79.1468616733914; Fri, 15 Jul 2016 14:05:33 -0700 (PDT) Received: from localhost.net (c-24-21-228-48.hsd1.wa.comcast.net. [24.21.228.48]) by smtp.gmail.com with ESMTPSA id o2sm101511pfg.10.2016.07.15.14.05.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2016 14:05:33 -0700 (PDT) From: Ping Cheng X-Google-Original-From: Ping Cheng To: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Cc: Ping Cheng , Peter Hutterer Subject: [PATCH] input: wacom_w8001 - cleanup 2FG touch code Date: Fri, 15 Jul 2016 14:00:45 -0700 Message-Id: <1468616445-6158-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP input_mt_sync_frame is used by other wacom devices in wacom_wac.c to close the frame and emulate pointer events. Let's follow them. Touch resolution was missing during touch setup. Newer apps won't be happy without that info. Signed-off-by: Ping Cheng Signed-off-by: Peter Hutterer --- drivers/input/touchscreen/wacom_w8001.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index fe983e7..a09dc65 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -170,16 +170,8 @@ static void parse_multi_touch(struct w8001 *w8001) } } - /* emulate single touch events when stylus is out of proximity. - * This is to make single touch backward support consistent - * across all Wacom single touch devices. - */ - if (w8001->type != BTN_TOOL_PEN && - w8001->type != BTN_TOOL_RUBBER) { - w8001->type = count == 1 ? BTN_TOOL_FINGER : KEY_RESERVED; - input_mt_report_pointer_emulation(dev, true); - } - + w8001->type = KEY_RESERVED; + input_mt_sync_frame(dev); input_sync(dev); } @@ -508,14 +500,13 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, case 5: w8001->pktlen = W8001_PKTLEN_TOUCH2FG; - __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); - input_mt_init_slots(dev, 2, 0); input_set_abs_params(dev, ABS_MT_POSITION_X, 0, touch.x, 0, 0); input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, touch.y, 0, 0); - input_set_abs_params(dev, ABS_MT_TOOL_TYPE, - 0, MT_TOOL_MAX, 0, 0); + input_abs_set_res(dev, ABS_MT_POSITION_X, touch.panel_res); + input_abs_set_res(dev, ABS_MT_POSITION_Y, touch.panel_res); + input_mt_init_slots(dev, 2, 0); strlcat(basename, " 2FG", basename_sz); if (w8001->max_pen_x && w8001->max_pen_y)