From patchwork Sun Nov 28 23:46:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 362582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oASNjduU030886 for ; Sun, 28 Nov 2010 23:45:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479Ab0K1Xpj (ORCPT ); Sun, 28 Nov 2010 18:45:39 -0500 Received: from mail-gw0-f46.google.com ([74.125.83.46]:40129 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840Ab0K1Xpi (ORCPT ); Sun, 28 Nov 2010 18:45:38 -0500 Received: by gwj20 with SMTP id 20so1726972gwj.19 for ; Sun, 28 Nov 2010 15:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=0/Nl8s0VlyfvDPa9AOW+4wqG5UnV5YTOa63AenSeOvA=; b=r9DGiE/Rk7FP3Ul0ICG0N/UtBzBFwV7aj6/uUVqmhvukUiJYltZ3RxJMekZdHJghv+ eii7NPAyt4IzXZ9QM81101KyQ3CTEbOaHoqxPIwHQ62+lSF7lpJenPf1qKnj+ffoJK6q 8nt+iuoxR7RVomvu3427B12FFGYV/8TTt8fmI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=uC2BD6IGLvrcxXWEePEKXkHgYdyC3UR9yQxoN6jAJ/w8o9DIT2uhYvBXQ6uMx3Mbg5 fUsxjTNo9eGLdJGNYIahnb6aLER2aRELTIpHs5sv7bR0ur13QME2d7epQjcDohJzsnzw 7FW+e3mQEhoPQt/NZeow35o2iq9a2Ixsx9Z9k= Received: by 10.150.186.14 with SMTP id j14mr9121923ybf.369.1290987936838; Sun, 28 Nov 2010 15:45:36 -0800 (PST) Received: from localhost.localdomain ([204.119.25.150]) by mx.google.com with ESMTPS id 54sm1653698yhl.32.2010.11.28.15.45.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Nov 2010 15:45:35 -0800 (PST) From: Ping Cheng To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, Ping Cheng , Ping Cheng Subject: [PATCH v2] Input: wacom - allow both MT and pen data to be reported Date: Sun, 28 Nov 2010 15:46:00 -0800 Message-Id: <1290987960-12118-1-git-send-email-pinglinux@gmail.com> X-Mailer: git-send-email 1.7.2.3 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 28 Nov 2010 23:45:40 +0000 (UTC) diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index b3252ef..e0826d1 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -868,13 +868,11 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) for (i = 0; i < 2; i++) { int p = data[9 * i + 2]; input_mt_slot(input, i); - /* - * Touch events need to be disabled while stylus is - * in proximity because user's hand is resting on touchpad - * and sending unwanted events. User expects tablet buttons - * to continue working though. + + /* MT events are sent even a stylus is in proximity. Clients + * have the opportunity to use or ignore them later. */ - if (p && !wacom->shared->stylus_in_proximity) { + if (p) { int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { @@ -894,13 +892,19 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) input_report_abs(input, ABS_MT_TRACKING_ID, wacom->id[i]); } - input_report_key(input, BTN_TOUCH, count > 0); - input_report_key(input, BTN_TOOL_FINGER, count == 1); - input_report_key(input, BTN_TOOL_DOUBLETAP, count == 2); - - input_report_abs(input, ABS_PRESSURE, sp); - input_report_abs(input, ABS_X, sx); - input_report_abs(input, ABS_Y, sy); + /* As discussed at linux-input and xorg-devel mailing lists, single + * touch events are ignored when pen is in prox to support backward + * compatibility + */ + if (!wacom->shared->stylus_in_proximity) { + input_report_key(input, BTN_TOUCH, count > 0); + input_report_key(input, BTN_TOOL_FINGER, count == 1); + input_report_key(input, BTN_TOOL_DOUBLETAP, count == 2); + + input_report_abs(input, ABS_PRESSURE, sp); + input_report_abs(input, ABS_X, sx); + input_report_abs(input, ABS_Y, sy); + } input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);