Skip to content

Commit 368c966

Browse files
PinglinuxJiri Kosina
authored andcommitted
HID: core: add two new usages for digitizer
On Feb 17, 2014, two new usages are approved to HID usage Table 18 - Digitizer Page: 5A Secondary Barrel Switch MC 16.4 5B Transducer Serial Number SV 16.3.1 This patch adds relevant definitions to hid/input. It also removes outdated comments in hid.h. Signed-off-by: Ping Cheng <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent dde3b45 commit 368c966

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

drivers/hid/hid-debug.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ static const struct hid_usage_entry hid_usage_table[] = {
165165
{0, 0x53, "DeviceIndex"},
166166
{0, 0x54, "ContactCount"},
167167
{0, 0x55, "ContactMaximumNumber"},
168+
{0, 0x5A, "SecondaryBarrelSwitch"},
169+
{0, 0x5B, "TransducerSerialNumber"},
168170
{ 15, 0, "PhysicalInterfaceDevice" },
169171
{0, 0x00, "Undefined"},
170172
{0, 0x01, "Physical_Interface_Device"},

drivers/hid/hid-input.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
684684
break;
685685

686686
case 0x46: /* TabletPick */
687+
case 0x5a: /* SecondaryBarrelSwitch */
687688
map_key_clear(BTN_STYLUS2);
688689
break;
689690

691+
case 0x5b: /* TransducerSerialNumber */
692+
set_bit(MSC_SERIAL, input->mscbit);
693+
break;
694+
690695
default: goto unknown;
691696
}
692697
break;

include/linux/hid.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,6 @@ struct hid_item {
233233
#define HID_DG_BARRELSWITCH 0x000d0044
234234
#define HID_DG_ERASER 0x000d0045
235235
#define HID_DG_TABLETPICK 0x000d0046
236-
/*
237-
* as of May 20, 2009 the usages below are not yet in the official USB spec
238-
* but are being pushed by Microsft as described in their paper "Digitizer
239-
* Drivers for Windows Touch and Pen-Based Computers"
240-
*/
241236
#define HID_DG_CONFIDENCE 0x000d0047
242237
#define HID_DG_WIDTH 0x000d0048
243238
#define HID_DG_HEIGHT 0x000d0049
@@ -246,6 +241,8 @@ struct hid_item {
246241
#define HID_DG_DEVICEINDEX 0x000d0053
247242
#define HID_DG_CONTACTCOUNT 0x000d0054
248243
#define HID_DG_CONTACTMAX 0x000d0055
244+
#define HID_DG_BARRELSWITCH2 0x000d005a
245+
#define HID_DG_TOOLSERIALNUMBER 0x000d005b
249246

250247
/*
251248
* HID report types --- Ouch! HID spec says 1 2 3!

0 commit comments

Comments
 (0)