All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gerecke <killertofu@gmail.com>
To: linux-input@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Ping Cheng <pinglinux@gmail.com>,
	Ping Cheng <ping.cheng@wacom.com>,
	Aaron Skomra <skomra@gmail.com>,
	Jason Gerecke <killertofu@gmail.com>,
	Jason Gerecke <jason.gerecke@wacom.com>
Subject: [PATCH v2 01/18] HID: wacom: Update vendor-defined usage names to better match standards
Date: Fri,  7 Oct 2016 15:16:36 -0700	[thread overview]
Message-ID: <20161007221653.26941-1-killertofu@gmail.com> (raw)
In-Reply-To: <20161006212231.31440-1-killertofu@gmail.com>

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 <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
 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 a48ed4e..e09830c 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2458,7 +2458,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 de5d1ad..3592186 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))
-- 
2.10.0


  parent reply	other threads:[~2016-10-07 22:18 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 21:22 [PATCH 00/19] HID: wacom: Add support for MobileStudio Pro Jason Gerecke
2016-10-06 21:22 ` [PATCH 01/19] HID: wacom: Update vendor-defined usage names to better match standards Jason Gerecke
2016-10-06 21:22 ` [PATCH 02/19] HID: wacom: Have WACOM_PEN_FIELD and WACOM_FINGER_FIELD recgonize more fields Jason Gerecke
2016-10-06 21:22 ` [PATCH 03/19] HID: wacom: Refactor button-to-key translation into function Jason Gerecke
2016-10-06 21:22 ` [PATCH 04/19] HID: wacom: Detect and correct descriptors missing HID_DG_BARRELSWITCH2 Jason Gerecke
2016-10-06 21:22 ` [PATCH 05/19] HID: wacom: generic: Strip off excessive name prefixing Jason Gerecke
2016-10-06 21:22 ` [PATCH 06/19] HID: wacom: generic: Add support for height, tilt, and twist usages Jason Gerecke
2016-10-06 21:22 ` [PATCH 07/19] HID: wacom: generic: Support and use 'Custom HID' mode and usages Jason Gerecke
2016-10-06 21:22 ` [PATCH 08/19] HID: wacom: generic: Add support for vendor-defined "Distance" usage Jason Gerecke
2016-10-06 21:22 ` [PATCH 09/19] HID: wacom: generic: Add support for vendor-defined "Fingerwheel" usage Jason Gerecke
2016-10-06 21:22 ` [PATCH 10/19] HID: wacom: generic: Add support for vendor-defined "Sense" usage Jason Gerecke
2016-10-06 21:22 ` [PATCH 11/19] HID: wacom: Read and internally use corrected Intuos tool IDs Jason Gerecke
2016-10-06 21:22 ` [PATCH 12/19] HID: wacom: generic: Support tool ID and additional tool types Jason Gerecke
2016-10-06 21:22 ` [PATCH 13/19] HID: wacom: generic: Pass 'hdev' to 'wacom_map_usage' Jason Gerecke
2016-10-07 15:46   ` Benjamin Tissoires
2016-10-07 20:53     ` Jason Gerecke
2016-10-06 21:22 ` [PATCH 14/19] HID: wacom: Fix sensor outbounds and redefine as offsets from each edge Jason Gerecke
2016-10-06 21:22 ` [PATCH 15/19] HID: wacom: generic: Add support for sensor offsets Jason Gerecke
2016-10-06 21:22 ` [PATCH 16/19] HID: wacom: generic: Introduce pad support Jason Gerecke
2016-10-06 21:22 ` [PATCH 17/19] HID: wacom: generic: Add support for battery status on pen and pad interfaces Jason Gerecke
2016-10-06 21:22 ` [PATCH 18/19] HID: wacom: generic: Extend pad support Jason Gerecke
2016-10-06 21:22 ` [PATCH 19/19] HID: input: Recognize ABS_WHEEL in hidinput_calc_abs_res Jason Gerecke
2016-10-07 15:41 ` [PATCH 00/19] HID: wacom: Add support for MobileStudio Pro Benjamin Tissoires
2016-10-07 22:16 ` Jason Gerecke [this message]
2016-10-07 22:16   ` [PATCH v2 02/18] HID: wacom: Have WACOM_PEN_FIELD and WACOM_FINGER_FIELD recgonize more fields Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 03/18] HID: wacom: Refactor button-to-key translation into function Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 04/18] HID: wacom: Detect and correct descriptors missing HID_DG_BARRELSWITCH2 Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 05/18] HID: wacom: generic: Strip off excessive name prefixing Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 06/18] HID: wacom: generic: Add support for height, tilt, and twist usages Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 07/18] HID: wacom: generic: Support and use 'Custom HID' mode and usages Jason Gerecke
2016-10-18 15:26     ` Jiri Kosina
2016-10-18 17:09       ` Jason Gerecke
2016-10-18 21:39         ` Jiri Kosina
2016-10-20  1:04           ` Jason Gerecke
2016-10-20  8:32             ` Jiri Kosina
2016-10-07 22:16   ` [PATCH v2 08/18] HID: wacom: generic: Add support for vendor-defined "Distance" usage Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 09/18] HID: wacom: generic: Add support for vendor-defined "Fingerwheel" usage Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 10/18] HID: wacom: generic: Add support for vendor-defined "Sense" usage Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 11/18] HID: wacom: Read and internally use corrected Intuos tool IDs Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 12/18] HID: wacom: generic: Support tool ID and additional tool types Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 13/18] HID: wacom: Fix sensor outbounds and redefine as offsets from each edge Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 14/18] HID: wacom: generic: Add support for sensor offsets Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 15/18] HID: wacom: generic: Introduce pad support Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 16/18] HID: wacom: generic: Add support for battery status on pen and pad interfaces Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 17/18] HID: wacom: generic: Extend pad support Jason Gerecke
2016-10-07 22:16   ` [PATCH v2 18/18] HID: input: Recognize ABS_WHEEL in hidinput_calc_abs_res Jason Gerecke
2016-10-20  1:03 ` [PATCH v3 01/18] HID: wacom: Update vendor-defined usage names to better match standards Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 02/18] HID: wacom: Have WACOM_PEN_FIELD and WACOM_FINGER_FIELD recgonize more fields Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 03/18] HID: wacom: Refactor button-to-key translation into function Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 04/18] HID: wacom: Detect and correct descriptors missing HID_DG_BARRELSWITCH2 Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 05/18] HID: wacom: generic: Strip off excessive name prefixing Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 06/18] HID: wacom: generic: Add support for height, tilt, and twist usages Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 07/18] HID: wacom: generic: Support and use 'Custom HID' mode and usages Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 08/18] HID: wacom: generic: Add support for vendor-defined "Distance" usage Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 09/18] HID: wacom: generic: Add support for vendor-defined "Fingerwheel" usage Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 10/18] HID: wacom: generic: Add support for vendor-defined "Sense" usage Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 11/18] HID: wacom: Read and internally use corrected Intuos tool IDs Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 12/18] HID: wacom: generic: Support tool ID and additional tool types Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 13/18] HID: wacom: Fix sensor outbounds and redefine as offsets from each edge Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 14/18] HID: wacom: generic: Add support for sensor offsets Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 15/18] HID: wacom: generic: Introduce pad support Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 16/18] HID: wacom: generic: Add support for battery status on pen and pad interfaces Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 17/18] HID: wacom: generic: Extend pad support Jason Gerecke
2016-10-20  1:03   ` [PATCH v3 18/18] HID: input: Recognize ABS_WHEEL in hidinput_calc_abs_res Jason Gerecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161007221653.26941-1-killertofu@gmail.com \
    --to=killertofu@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jason.gerecke@wacom.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=ping.cheng@wacom.com \
    --cc=pinglinux@gmail.com \
    --cc=skomra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.