Skip to content

Commit 8de8228

Browse files
jigpuJiri Kosina
authored andcommitted
HID: wacom: Update vendor-defined usage names to better match standards
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 <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 8a1e377 commit 8de8228

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

drivers/hid/wacom_sys.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,18 @@ static void wacom_feature_mapping(struct hid_device *hdev,
159159

160160
case HID_UP_DIGITIZER:
161161
if (field->report->id == 0x0B &&
162-
(field->application == WACOM_G9_DIGITIZER ||
163-
field->application == WACOM_G11_DIGITIZER)) {
162+
(field->application == WACOM_HID_G9_PEN ||
163+
field->application == WACOM_HID_G11_PEN)) {
164164
wacom->wacom_wac.mode_report = field->report->id;
165165
wacom->wacom_wac.mode_value = 0;
166166
}
167167
break;
168168

169-
case WACOM_G9_PAGE:
170-
case WACOM_G11_PAGE:
169+
case WACOM_HID_UP_G9:
170+
case WACOM_HID_UP_G11:
171171
if (field->report->id == 0x03 &&
172-
(field->application == WACOM_G9_TOUCHSCREEN ||
173-
field->application == WACOM_G11_TOUCHSCREEN)) {
172+
(field->application == WACOM_HID_G9_TOUCHSCREEN ||
173+
field->application == WACOM_HID_G11_TOUCHSCREEN)) {
174174
wacom->wacom_wac.mode_report = field->report->id;
175175
wacom->wacom_wac.mode_value = 0;
176176
}

drivers/hid/wacom_wac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2448,7 +2448,7 @@ void wacom_setup_device_quirks(struct wacom *wacom)
24482448
/*
24492449
* Raw Wacom-mode pen and touch events both come from interface
24502450
* 0, whose HID descriptor has an application usage of 0xFF0D
2451-
* (i.e., WACOM_VENDORDEFINED_PEN). We route pen packets back
2451+
* (i.e., WACOM_HID_WD_DIGITIZER). We route pen packets back
24522452
* out through the HID_GENERIC device created for interface 1,
24532453
* so rewrite this one to be of type WACOM_DEVICETYPE_TOUCH.
24542454
*/

drivers/hid/wacom_wac.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,21 @@
8484
#define WACOM_DEVICETYPE_WL_MONITOR 0x0008
8585
#define WACOM_DEVICETYPE_DIRECT 0x0010
8686

87-
#define WACOM_VENDORDEFINED_PEN 0xff0d0001
88-
#define WACOM_G9_PAGE 0xff090000
89-
#define WACOM_G9_DIGITIZER (WACOM_G9_PAGE | 0x02)
90-
#define WACOM_G9_TOUCHSCREEN (WACOM_G9_PAGE | 0x11)
91-
#define WACOM_G11_PAGE 0xff110000
92-
#define WACOM_G11_DIGITIZER (WACOM_G11_PAGE | 0x02)
93-
#define WACOM_G11_TOUCHSCREEN (WACOM_G11_PAGE | 0x11)
87+
#define WACOM_HID_UP_WACOMDIGITIZER 0xff0d0000
88+
#define WACOM_HID_WD_DIGITIZER (WACOM_HID_UP_WACOMDIGITIZER | 0x01)
89+
#define WACOM_HID_UP_G9 0xff090000
90+
#define WACOM_HID_G9_PEN (WACOM_HID_UP_G9 | 0x02)
91+
#define WACOM_HID_G9_TOUCHSCREEN (WACOM_HID_UP_G9 | 0x11)
92+
#define WACOM_HID_UP_G11 0xff110000
93+
#define WACOM_HID_G11_PEN (WACOM_HID_UP_G11 | 0x02)
94+
#define WACOM_HID_G11_TOUCHSCREEN (WACOM_HID_UP_G11 | 0x11)
9495

9596
#define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \
9697
((f)->physical == HID_DG_STYLUS) || \
9798
((f)->physical == HID_DG_PEN) || \
9899
((f)->application == HID_DG_PEN) || \
99100
((f)->application == HID_DG_DIGITIZER) || \
100-
((f)->application == WACOM_VENDORDEFINED_PEN))
101+
((f)->application == WACOM_HID_WD_DIGITIZER))
101102
#define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \
102103
((f)->physical == HID_DG_FINGER) || \
103104
((f)->application == HID_DG_TOUCHSCREEN))

0 commit comments

Comments
 (0)