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