From patchwork Tue Jan 27 21:29:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 5720691 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 54ADBBFFA8 for ; Tue, 27 Jan 2015 21:29:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A84620256 for ; Tue, 27 Jan 2015 21:29:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49FBD2024F for ; Tue, 27 Jan 2015 21:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759578AbbA0V27 (ORCPT ); Tue, 27 Jan 2015 16:28:59 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:38735 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759492AbbA0V26 (ORCPT ); Tue, 27 Jan 2015 16:28:58 -0500 Received: by mail-pd0-f169.google.com with SMTP id g10so21216148pdj.0 for ; Tue, 27 Jan 2015 13:28:57 -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=rCf/fJ+RHMYYKQ0HWNZFhyVH7/nOWiRnAJfQAwinues=; b=PJwn/RoWQA6oLgFOw9WaS/Kn/odX1e2IN0/E69XQmgAlROaqEXO5MEx0+gs1Qc9bnK IZGCfHpmEs6cC/gQFG3VUJPHAgWiHmtwwNS/l7rw6ugfbTuGOpT3oZfiIssjA+XFvVqz mAFM50F7JpPWNxAg38w/zIX24mflhf5hxm0U0EI2xB1G5/rYdUNKi8FOKSXQisnByj82 VWr75/OavfrK3G/mq4k8wVrkXix7N5CqmvbVKBqE/j8az9ZySKcMxw6Mt7BYCedmpYc0 S6FhjdXOJFHCJbt714x+RSjsTzeSeP1A9AqBiv+uWtL4eNJNG4tLTdb0uEb/Nt7f2ohX cotg== X-Received: by 10.68.222.40 with SMTP id qj8mr5395901pbc.51.1422394137710; Tue, 27 Jan 2015 13:28:57 -0800 (PST) Received: from wacom-XPS-8500.wacom.com ([67.51.163.2]) by mx.google.com with ESMTPSA id x16sm2512469pbt.66.2015.01.27.13.28.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jan 2015 13:28:56 -0800 (PST) From: Ping Cheng X-Google-Original-From: Ping Cheng To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, benjamin.tissoires@gmail.com, Ping Cheng Subject: [PATCH 1/3] Make sure touch arbitration is applied consistently across devices Date: Tue, 27 Jan 2015 13:29:11 -0800 Message-Id: <1422394151-15067-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Signed-off-by: Ping Cheng --- drivers/hid/wacom_wac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index f886149..6d490f6 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1042,7 +1042,7 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom) for (i = 0; i < contacts_to_send; i++) { int offset = (WACOM_BYTES_PER_24HDT_PACKET * i) + 1; - bool touch = data[offset] & 0x1 && !wacom->shared->stylus_in_proximity; + bool touch = (data[offset] & 0x1) && !wacom->shared->stylus_in_proximity; int slot = input_mt_get_slot_by_key(input, data[offset + 1]); if (slot < 0) @@ -1072,6 +1072,7 @@ static int wacom_24hdt_irq(struct wacom_wac *wacom) if (wacom->num_contacts_left <= 0) wacom->num_contacts_left = 0; + wacom->shared->touch_down = (wacom->num_contacts_left > 0); return 1; } @@ -1100,7 +1101,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom) for (i = 0; i < contacts_to_send; i++) { int offset = (WACOM_BYTES_PER_MT_PACKET + x_offset) * i + 3; - bool touch = data[offset] & 0x1; + bool touch = (data[offset] & 0x1) && !wacom->shared->stylus_in_proximity; int id = get_unaligned_le16(&data[offset + 1]); int slot = input_mt_get_slot_by_key(input, id); @@ -1122,6 +1123,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom) if (wacom->num_contacts_left < 0) wacom->num_contacts_left = 0; + wacom->shared->touch_down = (wacom->num_contacts_left > 0); return 1; }