From patchwork Thu Oct 20 01:03:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 9385683 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 58BD5607D0 for ; Thu, 20 Oct 2016 01:04:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4823C28DD7 for ; Thu, 20 Oct 2016 01:04:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B4CE296F3; Thu, 20 Oct 2016 01:04:08 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 A87C728DD7 for ; Thu, 20 Oct 2016 01:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228AbcJTBEH (ORCPT ); Wed, 19 Oct 2016 21:04:07 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34806 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752621AbcJTBEG (ORCPT ); Wed, 19 Oct 2016 21:04:06 -0400 Received: by mail-pf0-f194.google.com with SMTP id 128so3846713pfz.1 for ; Wed, 19 Oct 2016 18:04:05 -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:in-reply-to:references; bh=GwaogJGmIuEhKG4xAykAnogYxgGy0RbkYviwHOVnQXw=; b=MWh64gSTbm0CVwUo84i3eBU3pZ8k5uf4/xD7LybzHjAa7gkVSGTlkOQua8JR8wuceF 85xGX6jaXDSD4g/w9DPtq0iHJA2b1u/bbXTWeoePEaAGNTlSPxbTxTAgQiIYcQfiTqBs pvJ2LgnXV3yUNibBYvntygCNdHGX6ksHRG9gSljhaPbQoxWVyFa0wlU1fAJc/l3hV58N EGGluRqlVtsRjhLuc+7jsxW3yF2mSGgRHZRyXXssPDafwCtQwil/rcpAUHtXK0fRda0v eFvBvhstoO8JPFG2muKYtltDGx5nGWUXavi8aFIDNXiIGZwm5d4mcItq0gJHIzuBVfTY o9Eg== 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:in-reply-to :references; bh=GwaogJGmIuEhKG4xAykAnogYxgGy0RbkYviwHOVnQXw=; b=D2ryVqKfSIJFSoyLX7DvNdda7Wph90xneLgr7+TJhpNEtCOPxBnPExqIrUrwT4njfK Zw5hn1nWfo5s/Zggh5039JPCUEDQQsgLm0mx0V7/O7J1jozo+l9wB2MOZchsMKnzisCQ JuYPlaDRLquiDQlg+p6PcwgsnKKdWv7LFaPeDbQpzZY/w2VeiDp+nbDTJPAcaN3DR8/N xd97Z2qF+qlB4SA+SmKxpUbrGnHzxZo4gU83Kb1lBy5T5v3TBWqQLukixFmRCSqIGsKy xLDl4M2kSTpc1W2m0/QVUjcFnK0Mzak6sxWlj45EwQTEe5DYpKejttJ+IG6ZkN3+pjY6 HtUA== X-Gm-Message-State: AA6/9Rm7Cgd7mbzhZhRKT56eQVhuE7rOD7dJvLSN03xDptN9UrGXC7J2NubTxc3Mt8v+LA== X-Received: by 10.99.124.74 with SMTP id l10mr7488948pgn.63.1476925444025; Wed, 19 Oct 2016 18:04:04 -0700 (PDT) Received: from wtc005007.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id d15sm877372pfl.90.2016.10.19.18.03.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 18:04:02 -0700 (PDT) From: Jason Gerecke To: linux-input@vger.kernel.org, Jiri Kosina Cc: Benjamin Tissoires , Ping Cheng , Ping Cheng , Aaron Skomra , Jason Gerecke , Jason Gerecke Subject: [PATCH v3 01/18] HID: wacom: Update vendor-defined usage names to better match standards Date: Wed, 19 Oct 2016 18:03:37 -0700 Message-Id: <20161020010354.4049-1-killertofu@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161006212231.31440-1-killertofu@gmail.com> References: <20161006212231.31440-1-killertofu@gmail.com> 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 Our loose use of "pen" and "digitizer" in the naming of several of our vendor-defined usages may be a source of confusion given that the terms have specific meaning within the HID specification. "Pen" specifically refers to "an integrated display that allows the use of a stylus" (e.g. something like a tablet PC or Cintiq) wheras "Digitizer" is a better fit for opaque tablets like an Intuos. While we're at it, go ahead and rename the definitions to make them more distinct and better match up with the convention used by HID (e.g. the use of '_UP_' for usage pages) and make them more distinct. Signed-off-by: Jason Gerecke Reviewed-by: Benjamin Tissoires --- drivers/hid/wacom_sys.c | 12 ++++++------ drivers/hid/wacom_wac.c | 2 +- drivers/hid/wacom_wac.h | 17 +++++++++-------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 5e7a564..773fa11 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -159,18 +159,18 @@ static void wacom_feature_mapping(struct hid_device *hdev, case HID_UP_DIGITIZER: if (field->report->id == 0x0B && - (field->application == WACOM_G9_DIGITIZER || - field->application == WACOM_G11_DIGITIZER)) { + (field->application == WACOM_HID_G9_PEN || + field->application == WACOM_HID_G11_PEN)) { wacom->wacom_wac.mode_report = field->report->id; wacom->wacom_wac.mode_value = 0; } break; - case WACOM_G9_PAGE: - case WACOM_G11_PAGE: + case WACOM_HID_UP_G9: + case WACOM_HID_UP_G11: if (field->report->id == 0x03 && - (field->application == WACOM_G9_TOUCHSCREEN || - field->application == WACOM_G11_TOUCHSCREEN)) { + (field->application == WACOM_HID_G9_TOUCHSCREEN || + field->application == WACOM_HID_G11_TOUCHSCREEN)) { wacom->wacom_wac.mode_report = field->report->id; wacom->wacom_wac.mode_value = 0; } diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 1cb7992..3038954 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -2448,7 +2448,7 @@ void wacom_setup_device_quirks(struct wacom *wacom) /* * Raw Wacom-mode pen and touch events both come from interface * 0, whose HID descriptor has an application usage of 0xFF0D - * (i.e., WACOM_VENDORDEFINED_PEN). We route pen packets back + * (i.e., WACOM_HID_WD_DIGITIZER). We route pen packets back * out through the HID_GENERIC device created for interface 1, * so rewrite this one to be of type WACOM_DEVICETYPE_TOUCH. */ diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 324c40b..f58bbd1 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -84,20 +84,21 @@ #define WACOM_DEVICETYPE_WL_MONITOR 0x0008 #define WACOM_DEVICETYPE_DIRECT 0x0010 -#define WACOM_VENDORDEFINED_PEN 0xff0d0001 -#define WACOM_G9_PAGE 0xff090000 -#define WACOM_G9_DIGITIZER (WACOM_G9_PAGE | 0x02) -#define WACOM_G9_TOUCHSCREEN (WACOM_G9_PAGE | 0x11) -#define WACOM_G11_PAGE 0xff110000 -#define WACOM_G11_DIGITIZER (WACOM_G11_PAGE | 0x02) -#define WACOM_G11_TOUCHSCREEN (WACOM_G11_PAGE | 0x11) +#define WACOM_HID_UP_WACOMDIGITIZER 0xff0d0000 +#define WACOM_HID_WD_DIGITIZER (WACOM_HID_UP_WACOMDIGITIZER | 0x01) +#define WACOM_HID_UP_G9 0xff090000 +#define WACOM_HID_G9_PEN (WACOM_HID_UP_G9 | 0x02) +#define WACOM_HID_G9_TOUCHSCREEN (WACOM_HID_UP_G9 | 0x11) +#define WACOM_HID_UP_G11 0xff110000 +#define WACOM_HID_G11_PEN (WACOM_HID_UP_G11 | 0x02) +#define WACOM_HID_G11_TOUCHSCREEN (WACOM_HID_UP_G11 | 0x11) #define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \ ((f)->physical == HID_DG_STYLUS) || \ ((f)->physical == HID_DG_PEN) || \ ((f)->application == HID_DG_PEN) || \ ((f)->application == HID_DG_DIGITIZER) || \ - ((f)->application == WACOM_VENDORDEFINED_PEN)) + ((f)->application == WACOM_HID_WD_DIGITIZER)) #define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \ ((f)->physical == HID_DG_FINGER) || \ ((f)->application == HID_DG_TOUCHSCREEN))