• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_INPUT_H
20 #define _UAPI_INPUT_H
21 #include <sys/time.h>
22 #include <sys/ioctl.h>
23 #include <sys/types.h>
24 #include <linux/types.h>
25 #include "input-event-codes.h"
26 struct input_event {
27   struct timeval time;
28   __u16 type;
29   __u16 code;
30   __s32 value;
31 };
32 #define EV_VERSION 0x010001
33 struct input_id {
34   __u16 bustype;
35   __u16 vendor;
36   __u16 product;
37   __u16 version;
38 };
39 struct input_absinfo {
40   __s32 value;
41   __s32 minimum;
42   __s32 maximum;
43   __s32 fuzz;
44   __s32 flat;
45   __s32 resolution;
46 };
47 struct input_keymap_entry {
48 #define INPUT_KEYMAP_BY_INDEX (1 << 0)
49   __u8 flags;
50   __u8 len;
51   __u16 index;
52   __u32 keycode;
53   __u8 scancode[32];
54 };
55 struct input_mask {
56   __u32 type;
57   __u32 codes_size;
58   __u64 codes_ptr;
59 };
60 #define EVIOCGVERSION _IOR('E', 0x01, int)
61 #define EVIOCGID _IOR('E', 0x02, struct input_id)
62 #define EVIOCGREP _IOR('E', 0x03, unsigned int[2])
63 #define EVIOCSREP _IOW('E', 0x03, unsigned int[2])
64 #define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2])
65 #define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry)
66 #define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2])
67 #define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry)
68 #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len)
69 #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len)
70 #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len)
71 #define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len)
72 #define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len)
73 #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len)
74 #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len)
75 #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len)
76 #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len)
77 #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len)
78 #define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo)
79 #define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo)
80 #define EVIOCSFF _IOW('E', 0x80, struct ff_effect)
81 #define EVIOCRMFF _IOW('E', 0x81, int)
82 #define EVIOCGEFFECTS _IOR('E', 0x84, int)
83 #define EVIOCGRAB _IOW('E', 0x90, int)
84 #define EVIOCREVOKE _IOW('E', 0x91, int)
85 #define EVIOCGMASK _IOR('E', 0x92, struct input_mask)
86 #define EVIOCSMASK _IOW('E', 0x93, struct input_mask)
87 #define EVIOCSCLOCKID _IOW('E', 0xa0, int)
88 #define ID_BUS 0
89 #define ID_VENDOR 1
90 #define ID_PRODUCT 2
91 #define ID_VERSION 3
92 #define BUS_PCI 0x01
93 #define BUS_ISAPNP 0x02
94 #define BUS_USB 0x03
95 #define BUS_HIL 0x04
96 #define BUS_BLUETOOTH 0x05
97 #define BUS_VIRTUAL 0x06
98 #define BUS_ISA 0x10
99 #define BUS_I8042 0x11
100 #define BUS_XTKBD 0x12
101 #define BUS_RS232 0x13
102 #define BUS_GAMEPORT 0x14
103 #define BUS_PARPORT 0x15
104 #define BUS_AMIGA 0x16
105 #define BUS_ADB 0x17
106 #define BUS_I2C 0x18
107 #define BUS_HOST 0x19
108 #define BUS_GSC 0x1A
109 #define BUS_ATARI 0x1B
110 #define BUS_SPI 0x1C
111 #define BUS_RMI 0x1D
112 #define BUS_CEC 0x1E
113 #define BUS_INTEL_ISHTP 0x1F
114 #define MT_TOOL_FINGER 0
115 #define MT_TOOL_PEN 1
116 #define MT_TOOL_PALM 2
117 #define MT_TOOL_MAX 2
118 #define FF_STATUS_STOPPED 0x00
119 #define FF_STATUS_PLAYING 0x01
120 #define FF_STATUS_MAX 0x01
121 struct ff_replay {
122   __u16 length;
123   __u16 delay;
124 };
125 struct ff_trigger {
126   __u16 button;
127   __u16 interval;
128 };
129 struct ff_envelope {
130   __u16 attack_length;
131   __u16 attack_level;
132   __u16 fade_length;
133   __u16 fade_level;
134 };
135 struct ff_constant_effect {
136   __s16 level;
137   struct ff_envelope envelope;
138 };
139 struct ff_ramp_effect {
140   __s16 start_level;
141   __s16 end_level;
142   struct ff_envelope envelope;
143 };
144 struct ff_condition_effect {
145   __u16 right_saturation;
146   __u16 left_saturation;
147   __s16 right_coeff;
148   __s16 left_coeff;
149   __u16 deadband;
150   __s16 center;
151 };
152 struct ff_periodic_effect {
153   __u16 waveform;
154   __u16 period;
155   __s16 magnitude;
156   __s16 offset;
157   __u16 phase;
158   struct ff_envelope envelope;
159   __u32 custom_len;
160   __s16 __user * custom_data;
161 };
162 struct ff_rumble_effect {
163   __u16 strong_magnitude;
164   __u16 weak_magnitude;
165 };
166 struct ff_effect {
167   __u16 type;
168   __s16 id;
169   __u16 direction;
170   struct ff_trigger trigger;
171   struct ff_replay replay;
172   union {
173     struct ff_constant_effect constant;
174     struct ff_ramp_effect ramp;
175     struct ff_periodic_effect periodic;
176     struct ff_condition_effect condition[2];
177     struct ff_rumble_effect rumble;
178   } u;
179 };
180 #define FF_RUMBLE 0x50
181 #define FF_PERIODIC 0x51
182 #define FF_CONSTANT 0x52
183 #define FF_SPRING 0x53
184 #define FF_FRICTION 0x54
185 #define FF_DAMPER 0x55
186 #define FF_INERTIA 0x56
187 #define FF_RAMP 0x57
188 #define FF_EFFECT_MIN FF_RUMBLE
189 #define FF_EFFECT_MAX FF_RAMP
190 #define FF_SQUARE 0x58
191 #define FF_TRIANGLE 0x59
192 #define FF_SINE 0x5a
193 #define FF_SAW_UP 0x5b
194 #define FF_SAW_DOWN 0x5c
195 #define FF_CUSTOM 0x5d
196 #define FF_WAVEFORM_MIN FF_SQUARE
197 #define FF_WAVEFORM_MAX FF_CUSTOM
198 #define FF_GAIN 0x60
199 #define FF_AUTOCENTER 0x61
200 #define FF_MAX_EFFECTS FF_GAIN
201 #define FF_MAX 0x7f
202 #define FF_CNT (FF_MAX + 1)
203 #endif
204