xref: /linux/include/uapi/linux/hid.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  *  Copyright (c) 1999 Andreas Gal
4607ca46eSDavid Howells  *  Copyright (c) 2000-2001 Vojtech Pavlik
5607ca46eSDavid Howells  *  Copyright (c) 2006-2007 Jiri Kosina
6607ca46eSDavid Howells  */
7607ca46eSDavid Howells /*
8607ca46eSDavid Howells  * This program is free software; you can redistribute it and/or modify
9607ca46eSDavid Howells  * it under the terms of the GNU General Public License as published by
10607ca46eSDavid Howells  * the Free Software Foundation; either version 2 of the License, or
11607ca46eSDavid Howells  * (at your option) any later version.
12607ca46eSDavid Howells  *
13607ca46eSDavid Howells  * This program is distributed in the hope that it will be useful,
14607ca46eSDavid Howells  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15607ca46eSDavid Howells  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16607ca46eSDavid Howells  * GNU General Public License for more details.
17607ca46eSDavid Howells  *
18607ca46eSDavid Howells  * You should have received a copy of the GNU General Public License
19607ca46eSDavid Howells  * along with this program; if not, write to the Free Software
20607ca46eSDavid Howells  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21607ca46eSDavid Howells  *
22607ca46eSDavid Howells  * Should you need to contact me, the author, you can do so either by
23607ca46eSDavid Howells  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
24607ca46eSDavid Howells  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
25607ca46eSDavid Howells  */
26607ca46eSDavid Howells #ifndef _UAPI__HID_H
27607ca46eSDavid Howells #define _UAPI__HID_H
28607ca46eSDavid Howells 
29607ca46eSDavid Howells 
30607ca46eSDavid Howells 
31607ca46eSDavid Howells /*
32607ca46eSDavid Howells  * USB HID (Human Interface Device) interface class code
33607ca46eSDavid Howells  */
34607ca46eSDavid Howells 
35607ca46eSDavid Howells #define USB_INTERFACE_CLASS_HID		3
36607ca46eSDavid Howells 
37607ca46eSDavid Howells /*
38607ca46eSDavid Howells  * USB HID interface subclass and protocol codes
39607ca46eSDavid Howells  */
40607ca46eSDavid Howells 
41607ca46eSDavid Howells #define USB_INTERFACE_SUBCLASS_BOOT	1
42607ca46eSDavid Howells #define USB_INTERFACE_PROTOCOL_KEYBOARD	1
43607ca46eSDavid Howells #define USB_INTERFACE_PROTOCOL_MOUSE	2
44607ca46eSDavid Howells 
45607ca46eSDavid Howells /*
46ead77b65SBenjamin Tissoires  * HID report types --- Ouch! HID spec says 1 2 3!
47ead77b65SBenjamin Tissoires  */
48ead77b65SBenjamin Tissoires 
49ead77b65SBenjamin Tissoires enum hid_report_type {
50ead77b65SBenjamin Tissoires 	HID_INPUT_REPORT		= 0,
51ead77b65SBenjamin Tissoires 	HID_OUTPUT_REPORT		= 1,
52ead77b65SBenjamin Tissoires 	HID_FEATURE_REPORT		= 2,
53ead77b65SBenjamin Tissoires 
54ead77b65SBenjamin Tissoires 	HID_REPORT_TYPES,
55ead77b65SBenjamin Tissoires };
56ead77b65SBenjamin Tissoires 
57ead77b65SBenjamin Tissoires /*
58607ca46eSDavid Howells  * HID class requests
59607ca46eSDavid Howells  */
60607ca46eSDavid Howells 
61*735e1bb1SBenjamin Tissoires enum hid_class_request {
62*735e1bb1SBenjamin Tissoires 	HID_REQ_GET_REPORT		= 0x01,
63*735e1bb1SBenjamin Tissoires 	HID_REQ_GET_IDLE		= 0x02,
64*735e1bb1SBenjamin Tissoires 	HID_REQ_GET_PROTOCOL		= 0x03,
65*735e1bb1SBenjamin Tissoires 	HID_REQ_SET_REPORT		= 0x09,
66*735e1bb1SBenjamin Tissoires 	HID_REQ_SET_IDLE		= 0x0A,
67*735e1bb1SBenjamin Tissoires 	HID_REQ_SET_PROTOCOL		= 0x0B,
68*735e1bb1SBenjamin Tissoires };
69607ca46eSDavid Howells 
70607ca46eSDavid Howells /*
71607ca46eSDavid Howells  * HID class descriptor types
72607ca46eSDavid Howells  */
73607ca46eSDavid Howells 
74607ca46eSDavid Howells #define HID_DT_HID			(USB_TYPE_CLASS | 0x01)
75607ca46eSDavid Howells #define HID_DT_REPORT			(USB_TYPE_CLASS | 0x02)
76607ca46eSDavid Howells #define HID_DT_PHYSICAL			(USB_TYPE_CLASS | 0x03)
77607ca46eSDavid Howells 
78607ca46eSDavid Howells #define HID_MAX_DESCRIPTOR_SIZE		4096
79607ca46eSDavid Howells 
80607ca46eSDavid Howells 
81607ca46eSDavid Howells #endif /* _UAPI__HID_H */
82