• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef _UAPI_LINUX_JOYSTICK_H
7 #define _UAPI_LINUX_JOYSTICK_H
8 #include <linux/types.h>
9 #include <linux/input.h>
10 #define JS_VERSION		0x020100
11 #define JS_EVENT_BUTTON		0x01
12 #define JS_EVENT_AXIS		0x02
13 #define JS_EVENT_INIT		0x80
14 struct js_event {
15 	__u32 time;
16 	__s16 value;
17 	__u8 type;
18 	__u8 number;
19 };
20 #define JSIOCGVERSION		_IOR('j', 0x01, __u32)
21 #define JSIOCGAXES		_IOR('j', 0x11, __u8)
22 #define JSIOCGBUTTONS		_IOR('j', 0x12, __u8)
23 #define JSIOCGNAME(len)		_IOC(_IOC_READ, 'j', 0x13, len)
24 #define JSIOCSCORR		_IOW('j', 0x21, struct js_corr)
25 #define JSIOCGCORR		_IOR('j', 0x22, struct js_corr)
26 #define JSIOCSAXMAP		_IOW('j', 0x31, __u8[ABS_CNT])
27 #define JSIOCGAXMAP		_IOR('j', 0x32, __u8[ABS_CNT])
28 #define JSIOCSBTNMAP		_IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1])
29 #define JSIOCGBTNMAP		_IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1])
30 #define JS_CORR_NONE		0x00
31 #define JS_CORR_BROKEN		0x01
32 struct js_corr {
33 	__s32 coef[8];
34 	__s16 prec;
35 	__u16 type;
36 };
37 #define JS_RETURN		sizeof(struct JS_DATA_TYPE)
38 #define JS_TRUE			1
39 #define JS_FALSE		0
40 #define JS_X_0			0x01
41 #define JS_Y_0			0x02
42 #define JS_X_1			0x04
43 #define JS_Y_1			0x08
44 #define JS_MAX			2
45 #define JS_DEF_TIMEOUT		0x1300
46 #define JS_DEF_CORR		0
47 #define JS_DEF_TIMELIMIT	10L
48 #define JS_SET_CAL		1
49 #define JS_GET_CAL		2
50 #define JS_SET_TIMEOUT		3
51 #define JS_GET_TIMEOUT		4
52 #define JS_SET_TIMELIMIT	5
53 #define JS_GET_TIMELIMIT	6
54 #define JS_GET_ALL		7
55 #define JS_SET_ALL		8
56 struct JS_DATA_TYPE {
57 	__s32 buttons;
58 	__s32 x;
59 	__s32 y;
60 };
61 struct JS_DATA_SAVE_TYPE_32 {
62 	__s32 JS_TIMEOUT;
63 	__s32 BUSY;
64 	__s32 JS_EXPIRETIME;
65 	__s32 JS_TIMELIMIT;
66 	struct JS_DATA_TYPE JS_SAVE;
67 	struct JS_DATA_TYPE JS_CORR;
68 };
69 struct JS_DATA_SAVE_TYPE_64 {
70 	__s32 JS_TIMEOUT;
71 	__s32 BUSY;
72 	__s64 JS_EXPIRETIME;
73 	__s64 JS_TIMELIMIT;
74 	struct JS_DATA_TYPE JS_SAVE;
75 	struct JS_DATA_TYPE JS_CORR;
76 };
77 #endif
78