From patchwork Fri Jul 15 23:26:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9232865 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 9AA6F60868 for ; Fri, 15 Jul 2016 23:26:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EC151FE82 for ; Fri, 15 Jul 2016 23:26:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83611262FF; Fri, 15 Jul 2016 23:26:38 +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 0396C1FE82 for ; Fri, 15 Jul 2016 23:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751731AbcGOX0h (ORCPT ); Fri, 15 Jul 2016 19:26:37 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:35440 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751572AbcGOX0g (ORCPT ); Fri, 15 Jul 2016 19:26:36 -0400 Received: by mail-pa0-f66.google.com with SMTP id dx3so6868080pab.2 for ; Fri, 15 Jul 2016 16:26:36 -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=7WAd3BrlBaqjogWI1/XOXp7wXzPZjkKCKdPPekeh5fw=; b=DWLoYs2KtiFd8J3pnT4unGLUi8B9nZdGpQuMYPRWK7Xx54eYnPU7VBfylP6gwPo2AT 55T3BcbDObJ0DuP8mY0WkXbMKYIh0eSPnJwE01Ohk1SfrqInfdInJodcX6tPx9QPI5bY FGp5czUNJBGO0qw1vPujwjwpje+OUOhzkmp/cOIFu9z33e2uamTVJuTjPddtvFh4jT2v 057qgtts1P1hdJ6tgDXWj3FFXgR7q3AEQHnphzZvmlLVwkaKJFx3Zc43+6vn/gcde0L8 7oz5aoOPF++wf6nU2Xo+74oDF5i5t2/zbbcIOp4KTIqcLYScZLgeiLEnCf475d/xhBSh 8ldw== 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=7WAd3BrlBaqjogWI1/XOXp7wXzPZjkKCKdPPekeh5fw=; b=eSmkwWmXpCIAejPlyoL6cKutse0ek/foZhEub0f4VHB/rp2fzu12rPGNq7jiQstYT9 jNCwUYhIP1N17xf2r3FO03CMFWFgIWrVjUQM2vlQoQhauZrlXrl8gJeQ1zHoVSxU/5hB QwdjMii3SMKmffXUmNaAtBI1L+mS3q5mBl/KkqoWda6Atc4wwh3B4rri+M3XA8X7oPW4 tEYofGAn/f1n/CJoI7ptb7Gvm0YCyslEDOLushy4uSwnjXMomKZJkVTPYciX8IXjT1N6 PuO9UHUILac/FosAZ1px6McFo17MyNiiUj7T1PX0ArPEcbXF2Nh4+KWMeRjBxhcu0vMu WYaA== X-Gm-Message-State: ALyK8tLxk7IC/0gzwqkWAIahiH3AvsowMFLHVMsgC2mP/k3JLkUaah+qVAUJX+H9t0y9SA== X-Received: by 10.66.167.103 with SMTP id zn7mr35668051pab.149.1468625196008; Fri, 15 Jul 2016 16:26:36 -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 d5sm3351127pfc.4.2016.07.15.16.26.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2016 16:26:35 -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 2/2 v2] input: wacom_w8001 - cleanup 2FG touch code Date: Fri, 15 Jul 2016 16:26:25 -0700 Message-Id: <1468625185-17820-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 events aren't multiplexed over the same device anymore, the use of ABS_MT_TOOL_TYPE is superfluous. Signed-off-by: Ping Cheng Signed-off-by: Peter Hutterer --- v2: moved input_abs_set_res into a separate patch, as suggested by Dmitry. --- drivers/input/touchscreen/wacom_w8001.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index 7e807af..541a8df 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,7 +500,6 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, case 5: w8001->pktlen = W8001_PKTLEN_TOUCH2FG; - __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); error = input_mt_init_slots(dev, 2, 0); if (error) { pr_debug("w8001: failed to initialize MT slots: %d\n", error); @@ -519,8 +510,6 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, 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);