From patchwork Fri Feb 20 22:25:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 5858691 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8023CBF440 for ; Fri, 20 Feb 2015 22:26:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B58BB20453 for ; Fri, 20 Feb 2015 22:26:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F6E320429 for ; Fri, 20 Feb 2015 22:26:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754574AbbBTW0H (ORCPT ); Fri, 20 Feb 2015 17:26:07 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:39800 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752745AbbBTW0H (ORCPT ); Fri, 20 Feb 2015 17:26:07 -0500 Received: by pdjy10 with SMTP id y10so10605645pdj.6 for ; Fri, 20 Feb 2015 14:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=SeFcvkTLfyNn3xpNuP2+xA4bdt+K8DHGsK5n7jEptJ0=; b=HAAlO2Z5pMDY3Stf1TWryZxtBUAfE5NwGeRRI93XHZPnFhrt0eTGixEr9ckGwc6I9X /stYg3UjQy2/M8vsJOW2sDF8NLDNKv1iu5JcI7ENnZ5IH7z9cONyjoCmAKIepBOoGUBt 2M/Hpcof1tM/stSq55EMHK/6E0sGKpsdHdoTwbznGHWb3bgptx34+A7ozY+kUp9Ougmm mrYoSggOZ2M2qY//kpuc/3BrBVS66nzQiUxoCOrt0paiGfDKv15JiGL94P1vTR8ZJ14a 9Rqd0Xjh3RRyEHW4n13wBW1Us//+Oaryw3lliXGhu63fAqFO2AungjkmBJhB5aTweWrq PnxA== X-Received: by 10.68.98.98 with SMTP id eh2mr20562437pbb.112.1424471165669; Fri, 20 Feb 2015 14:26:05 -0800 (PST) Received: from wacom-XPS-8500.wacom.com ([67.51.163.2]) by mx.google.com with ESMTPSA id qm12sm28004358pdb.36.2015.02.20.14.26.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Feb 2015 14:26:05 -0800 (PST) From: Ping Cheng X-Google-Original-From: Ping Cheng To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, Ping Cheng Subject: [PATCH 1/2] HID: wacom: do not send pen events before touch is up/forced out Date: Fri, 20 Feb 2015 14:25:58 -0800 Message-Id: <1424471158-4668-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.9.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If pen comes in proximity while touch is down, we force touch up before sending pen events. Otherwise, there can be unfinished touch events compete with pen events. This idea has been fully implemented for Tablet PCs. But other tablets that support both pen and touch are not fully considered. Signed-off-by: Ping Cheng Acked-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 046351c..69827c9 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -554,6 +554,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) if (features->quirks & WACOM_QUIRK_MULTI_INPUT) wacom->shared->stylus_in_proximity = true; + if (wacom->shared->touch_down) + return 1; + /* in Range while exiting */ if (((data[1] & 0xfe) == 0x20) && wacom->reporting_data) { input_report_key(input, BTN_TOUCH, 0); @@ -1759,6 +1762,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom) return 0; } + if (wacom->shared->touch_down) + return 0; + prox = (data[1] & 0x20) == 0x20; /*