aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/joystick.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/joystick.h')
-rw-r--r--include/linux/joystick.h114
1 files changed, 3 insertions, 111 deletions
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index 47199b13e0eb..cbf2aa9e93b9 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -1,12 +1,8 @@
1#ifndef _LINUX_JOYSTICK_H
2#define _LINUX_JOYSTICK_H
3
4/* 1/*
5 * Copyright (C) 1996-2000 Vojtech Pavlik 2 * Copyright (C) 1996-2000 Vojtech Pavlik
6 * 3 *
7 * Sponsored by SuSE 4 * Sponsored by SuSE
8 */ 5 */
9
10/* 6/*
11 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -26,113 +22,11 @@
26 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail: 22 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
27 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic 23 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
28 */ 24 */
25#ifndef _LINUX_JOYSTICK_H
26#define _LINUX_JOYSTICK_H
29 27
30#include <linux/types.h> 28#include <uapi/linux/joystick.h>
31#include <linux/input.h>
32
33/*
34 * Version
35 */
36
37#define JS_VERSION 0x020100
38
39/*
40 * Types and constants for reading from /dev/js
41 */
42
43#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
44#define JS_EVENT_AXIS 0x02 /* joystick moved */
45#define JS_EVENT_INIT 0x80 /* initial state of device */
46
47struct js_event {
48 __u32 time; /* event timestamp in milliseconds */
49 __s16 value; /* value */
50 __u8 type; /* event type */
51 __u8 number; /* axis/button number */
52};
53
54/*
55 * IOCTL commands for joystick driver
56 */
57
58#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */
59
60#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */
61#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */
62#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
63
64#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
65#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
66
67#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT]) /* set axis mapping */
68#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT]) /* get axis mapping */
69#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */
70#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */
71
72/*
73 * Types and constants for get/set correction
74 */
75
76#define JS_CORR_NONE 0x00 /* returns raw values */
77#define JS_CORR_BROKEN 0x01 /* broken line */
78
79struct js_corr {
80 __s32 coef[8];
81 __s16 prec;
82 __u16 type;
83};
84
85/*
86 * v0.x compatibility definitions
87 */
88
89#define JS_RETURN sizeof(struct JS_DATA_TYPE)
90#define JS_TRUE 1
91#define JS_FALSE 0
92#define JS_X_0 0x01
93#define JS_Y_0 0x02
94#define JS_X_1 0x04
95#define JS_Y_1 0x08
96#define JS_MAX 2
97
98#define JS_DEF_TIMEOUT 0x1300
99#define JS_DEF_CORR 0
100#define JS_DEF_TIMELIMIT 10L
101
102#define JS_SET_CAL 1
103#define JS_GET_CAL 2
104#define JS_SET_TIMEOUT 3
105#define JS_GET_TIMEOUT 4
106#define JS_SET_TIMELIMIT 5
107#define JS_GET_TIMELIMIT 6
108#define JS_GET_ALL 7
109#define JS_SET_ALL 8
110
111struct JS_DATA_TYPE {
112 __s32 buttons;
113 __s32 x;
114 __s32 y;
115};
116
117struct JS_DATA_SAVE_TYPE_32 {
118 __s32 JS_TIMEOUT;
119 __s32 BUSY;
120 __s32 JS_EXPIRETIME;
121 __s32 JS_TIMELIMIT;
122 struct JS_DATA_TYPE JS_SAVE;
123 struct JS_DATA_TYPE JS_CORR;
124};
125
126struct JS_DATA_SAVE_TYPE_64 {
127 __s32 JS_TIMEOUT;
128 __s32 BUSY;
129 __s64 JS_EXPIRETIME;
130 __s64 JS_TIMELIMIT;
131 struct JS_DATA_TYPE JS_SAVE;
132 struct JS_DATA_TYPE JS_CORR;
133};
134 29
135#ifdef __KERNEL__
136#if BITS_PER_LONG == 64 30#if BITS_PER_LONG == 64
137#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64 31#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64
138#elif BITS_PER_LONG == 32 32#elif BITS_PER_LONG == 32
@@ -140,6 +34,4 @@ struct JS_DATA_SAVE_TYPE_64 {
140#else 34#else
141#error Unexpected BITS_PER_LONG 35#error Unexpected BITS_PER_LONG
142#endif 36#endif
143#endif
144
145#endif /* _LINUX_JOYSTICK_H */ 37#endif /* _LINUX_JOYSTICK_H */