From patchwork Mon Nov 24 23:32:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 5370931 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 06742C11AC for ; Mon, 24 Nov 2014 23:32:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3075020158 for ; Mon, 24 Nov 2014 23:32:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6277D2014A for ; Mon, 24 Nov 2014 23:32:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239AbaKXXc0 (ORCPT ); Mon, 24 Nov 2014 18:32:26 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:47354 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbaKXXc0 (ORCPT ); Mon, 24 Nov 2014 18:32:26 -0500 Received: by mail-pd0-f169.google.com with SMTP id fp1so10608031pdb.14 for ; Mon, 24 Nov 2014 15:32:26 -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:in-reply-to:references; bh=w6U4KDVXuBFZeb8N6KZ/CNguAdKs1XpdpFokVs/nEf4=; b=ApLVO/HLTfyaqh4dYbGrMrWRhelFXP1W60yG5dJEz7o4PzdZKsn7ZZCh+DDBrzxCAh 1YS2pUSz1PCQGxgH8cBlBIDBgT7VFnGhXVJqhY8NQUV2uDXEImf9qJk1gyEcrHMNrUsY x3YBnwhY5nMN2hhQVf1wkb9Hxe/AaspmdTmEy1QYvxxQWNluWweHeEQSVfvaO5FOQxNt su+/uOOvLl47altKy7vpOYjTNJ4p1Xp15B3FmttXTPyRxR/8rJEyU8iCvwqaXstJ8pC1 7nVBYR51Duvye8G2Pq424v6KmUq7aavCY4KKcIr45cyH1XHKtoZ5GIiTpOzYeXKhWqTa oD7w== X-Received: by 10.68.162.100 with SMTP id xz4mr37676635pbb.138.1416871945986; Mon, 24 Nov 2014 15:32:25 -0800 (PST) Received: from wacom-arch2.localdomain ([67.51.163.2]) by mx.google.com with ESMTPSA id pc10sm13383820pbb.21.2014.11.24.15.32.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Nov 2014 15:32:24 -0800 (PST) From: Jason Gerecke To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, benjamin.tissoires@gmail.com, pinglinux@gmail.com, Jason Gerecke Subject: [PATCH 1/3] HID: wacom: Consult the application usage when determining field type Date: Mon, 24 Nov 2014 15:32:12 -0800 Message-Id: <1416871934-14133-2-git-send-email-killertofu@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416871934-14133-1-git-send-email-killertofu@gmail.com> References: <1416871934-14133-1-git-send-email-killertofu@gmail.com> 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 It is not necessarily sufficient to look only at the physical and logical usages when determining if a field is for the pen or touch. Some fields are not contained in a sub-collection and thus only have an application usage. Not checking the application usage in such cases causes us to ignore the field entirely, which may lead to incorrect behavior. Signed-off-by: Jason Gerecke --- 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 9565d31..1468f00 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1484,9 +1484,11 @@ static void wacom_wac_finger_report(struct hid_device *hdev, } #define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \ - ((f)->physical == HID_DG_STYLUS)) + ((f)->physical == HID_DG_STYLUS) || \ + ((f)->application == HID_DG_PEN)) #define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \ - ((f)->physical == HID_DG_FINGER)) + ((f)->physical == HID_DG_FINGER) || \ + ((f)->application == HID_DG_TOUCHSCREEN)) void wacom_wac_usage_mapping(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage)