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 #if __BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64) 28 struct timeval time; 29 #define input_event_sec time.tv_sec 30 #define input_event_usec time.tv_usec 31 #else 32 __kernel_ulong_t __sec; 33 #if defined(__sparc__) && defined(__arch64__) 34 unsigned int __usec; 35 #else 36 __kernel_ulong_t __usec; 37 #endif 38 #define input_event_sec __sec 39 #define input_event_usec __usec 40 #endif 41 __u16 type; 42 __u16 code; 43 __s32 value; 44 }; 45 #define EV_VERSION 0x010001 46 struct input_id { 47 __u16 bustype; 48 __u16 vendor; 49 __u16 product; 50 __u16 version; 51 }; 52 struct input_absinfo { 53 __s32 value; 54 __s32 minimum; 55 __s32 maximum; 56 __s32 fuzz; 57 __s32 flat; 58 __s32 resolution; 59 }; 60 struct input_keymap_entry { 61 #define INPUT_KEYMAP_BY_INDEX (1 << 0) 62 __u8 flags; 63 __u8 len; 64 __u16 index; 65 __u32 keycode; 66 __u8 scancode[32]; 67 }; 68 struct input_mask { 69 __u32 type; 70 __u32 codes_size; 71 __u64 codes_ptr; 72 }; 73 #define EVIOCGVERSION _IOR('E', 0x01, int) 74 #define EVIOCGID _IOR('E', 0x02, struct input_id) 75 #define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) 76 #define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) 77 #define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) 78 #define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry) 79 #define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) 80 #define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry) 81 #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) 82 #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) 83 #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) 84 #define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) 85 #define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len) 86 #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) 87 #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) 88 #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) 89 #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) 90 #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len) 91 #define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo) 92 #define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo) 93 #define EVIOCSFF _IOW('E', 0x80, struct ff_effect) 94 #define EVIOCRMFF _IOW('E', 0x81, int) 95 #define EVIOCGEFFECTS _IOR('E', 0x84, int) 96 #define EVIOCGRAB _IOW('E', 0x90, int) 97 #define EVIOCREVOKE _IOW('E', 0x91, int) 98 #define EVIOCGMASK _IOR('E', 0x92, struct input_mask) 99 #define EVIOCSMASK _IOW('E', 0x93, struct input_mask) 100 #define EVIOCSCLOCKID _IOW('E', 0xa0, int) 101 #define ID_BUS 0 102 #define ID_VENDOR 1 103 #define ID_PRODUCT 2 104 #define ID_VERSION 3 105 #define BUS_PCI 0x01 106 #define BUS_ISAPNP 0x02 107 #define BUS_USB 0x03 108 #define BUS_HIL 0x04 109 #define BUS_BLUETOOTH 0x05 110 #define BUS_VIRTUAL 0x06 111 #define BUS_ISA 0x10 112 #define BUS_I8042 0x11 113 #define BUS_XTKBD 0x12 114 #define BUS_RS232 0x13 115 #define BUS_GAMEPORT 0x14 116 #define BUS_PARPORT 0x15 117 #define BUS_AMIGA 0x16 118 #define BUS_ADB 0x17 119 #define BUS_I2C 0x18 120 #define BUS_HOST 0x19 121 #define BUS_GSC 0x1A 122 #define BUS_ATARI 0x1B 123 #define BUS_SPI 0x1C 124 #define BUS_RMI 0x1D 125 #define BUS_CEC 0x1E 126 #define BUS_INTEL_ISHTP 0x1F 127 #define MT_TOOL_FINGER 0x00 128 #define MT_TOOL_PEN 0x01 129 #define MT_TOOL_PALM 0x02 130 #define MT_TOOL_DIAL 0x0a 131 #define MT_TOOL_MAX 0x0f 132 #define FF_STATUS_STOPPED 0x00 133 #define FF_STATUS_PLAYING 0x01 134 #define FF_STATUS_MAX 0x01 135 struct ff_replay { 136 __u16 length; 137 __u16 delay; 138 }; 139 struct ff_trigger { 140 __u16 button; 141 __u16 interval; 142 }; 143 struct ff_envelope { 144 __u16 attack_length; 145 __u16 attack_level; 146 __u16 fade_length; 147 __u16 fade_level; 148 }; 149 struct ff_constant_effect { 150 __s16 level; 151 struct ff_envelope envelope; 152 }; 153 struct ff_ramp_effect { 154 __s16 start_level; 155 __s16 end_level; 156 struct ff_envelope envelope; 157 }; 158 struct ff_condition_effect { 159 __u16 right_saturation; 160 __u16 left_saturation; 161 __s16 right_coeff; 162 __s16 left_coeff; 163 __u16 deadband; 164 __s16 center; 165 }; 166 struct ff_periodic_effect { 167 __u16 waveform; 168 __u16 period; 169 __s16 magnitude; 170 __s16 offset; 171 __u16 phase; 172 struct ff_envelope envelope; 173 __u32 custom_len; 174 __s16 __user * custom_data; 175 }; 176 struct ff_rumble_effect { 177 __u16 strong_magnitude; 178 __u16 weak_magnitude; 179 }; 180 struct ff_effect { 181 __u16 type; 182 __s16 id; 183 __u16 direction; 184 struct ff_trigger trigger; 185 struct ff_replay replay; 186 union { 187 struct ff_constant_effect constant; 188 struct ff_ramp_effect ramp; 189 struct ff_periodic_effect periodic; 190 struct ff_condition_effect condition[2]; 191 struct ff_rumble_effect rumble; 192 } u; 193 }; 194 #define FF_RUMBLE 0x50 195 #define FF_PERIODIC 0x51 196 #define FF_CONSTANT 0x52 197 #define FF_SPRING 0x53 198 #define FF_FRICTION 0x54 199 #define FF_DAMPER 0x55 200 #define FF_INERTIA 0x56 201 #define FF_RAMP 0x57 202 #define FF_EFFECT_MIN FF_RUMBLE 203 #define FF_EFFECT_MAX FF_RAMP 204 #define FF_SQUARE 0x58 205 #define FF_TRIANGLE 0x59 206 #define FF_SINE 0x5a 207 #define FF_SAW_UP 0x5b 208 #define FF_SAW_DOWN 0x5c 209 #define FF_CUSTOM 0x5d 210 #define FF_WAVEFORM_MIN FF_SQUARE 211 #define FF_WAVEFORM_MAX FF_CUSTOM 212 #define FF_GAIN 0x60 213 #define FF_AUTOCENTER 0x61 214 #define FF_MAX_EFFECTS FF_GAIN 215 #define FF_MAX 0x7f 216 #define FF_CNT (FF_MAX + 1) 217 #endif 218