blob: 1df1398f79d64d0045671a473e6f579beceb9cef [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <sys/types.h>
24#include <linux/types.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080025#include "input-event-codes.h"
Ben Cheng655a7c02013-10-16 16:09:24 -070026struct input_event {
Christopher Ferrisd842e432019-03-07 10:21:59 -080027#if __BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)
Christopher Ferris05d08e92016-02-04 13:16:38 -080028 struct timeval time;
Christopher Ferris76a1d452018-06-27 14:12:29 -070029#define input_event_sec time.tv_sec
30#define input_event_usec time.tv_usec
31#else
32 __kernel_ulong_t __sec;
Christopher Ferrisd842e432019-03-07 10:21:59 -080033#if defined(__sparc__) && defined(__arch64__)
34 unsigned int __usec;
Christopher Ferrisd32ca142020-02-04 16:16:51 -080035 unsigned int __pad;
Christopher Ferrisd842e432019-03-07 10:21:59 -080036#else
Christopher Ferris76a1d452018-06-27 14:12:29 -070037 __kernel_ulong_t __usec;
Christopher Ferrisd842e432019-03-07 10:21:59 -080038#endif
Christopher Ferris76a1d452018-06-27 14:12:29 -070039#define input_event_sec __sec
40#define input_event_usec __usec
41#endif
Tao Baod7db5942015-01-28 10:07:51 -080042 __u16 type;
43 __u16 code;
44 __s32 value;
Christopher Ferris05d08e92016-02-04 13:16:38 -080045};
Ben Cheng655a7c02013-10-16 16:09:24 -070046#define EV_VERSION 0x010001
47struct input_id {
Tao Baod7db5942015-01-28 10:07:51 -080048 __u16 bustype;
Christopher Ferris05d08e92016-02-04 13:16:38 -080049 __u16 vendor;
Tao Baod7db5942015-01-28 10:07:51 -080050 __u16 product;
51 __u16 version;
Ben Cheng655a7c02013-10-16 16:09:24 -070052};
Christopher Ferris05d08e92016-02-04 13:16:38 -080053struct input_absinfo {
Tao Baod7db5942015-01-28 10:07:51 -080054 __s32 value;
55 __s32 minimum;
56 __s32 maximum;
Christopher Ferris05d08e92016-02-04 13:16:38 -080057 __s32 fuzz;
Tao Baod7db5942015-01-28 10:07:51 -080058 __s32 flat;
59 __s32 resolution;
Ben Cheng655a7c02013-10-16 16:09:24 -070060};
Christopher Ferris05d08e92016-02-04 13:16:38 -080061struct input_keymap_entry {
Ben Cheng655a7c02013-10-16 16:09:24 -070062#define INPUT_KEYMAP_BY_INDEX (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -080063 __u8 flags;
64 __u8 len;
Christopher Ferris05d08e92016-02-04 13:16:38 -080065 __u16 index;
Tao Baod7db5942015-01-28 10:07:51 -080066 __u32 keycode;
67 __u8 scancode[32];
Ben Cheng655a7c02013-10-16 16:09:24 -070068};
Christopher Ferris05d08e92016-02-04 13:16:38 -080069struct input_mask {
70 __u32 type;
71 __u32 codes_size;
72 __u64 codes_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -080073};
74#define EVIOCGVERSION _IOR('E', 0x01, int)
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define EVIOCGID _IOR('E', 0x02, struct input_id)
76#define EVIOCGREP _IOR('E', 0x03, unsigned int[2])
77#define EVIOCSREP _IOW('E', 0x03, unsigned int[2])
78#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2])
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry)
80#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2])
81#define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry)
82#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len)
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len)
84#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len)
85#define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len)
86#define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len)
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len)
88#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len)
89#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len)
90#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len)
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len)
92#define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo)
Christopher Ferris05d08e92016-02-04 13:16:38 -080093#define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo)
94#define EVIOCSFF _IOW('E', 0x80, struct ff_effect)
Ben Cheng655a7c02013-10-16 16:09:24 -070095#define EVIOCRMFF _IOW('E', 0x81, int)
96#define EVIOCGEFFECTS _IOR('E', 0x84, int)
97#define EVIOCGRAB _IOW('E', 0x90, int)
Christopher Ferris38062f92014-07-09 15:33:25 -070098#define EVIOCREVOKE _IOW('E', 0x91, int)
Christopher Ferris05d08e92016-02-04 13:16:38 -080099#define EVIOCGMASK _IOR('E', 0x92, struct input_mask)
100#define EVIOCSMASK _IOW('E', 0x93, struct input_mask)
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800101#define EVIOCSCLOCKID _IOW('E', 0xa0, int)
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#define ID_BUS 0
103#define ID_VENDOR 1
104#define ID_PRODUCT 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700105#define ID_VERSION 3
106#define BUS_PCI 0x01
107#define BUS_ISAPNP 0x02
108#define BUS_USB 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define BUS_HIL 0x04
110#define BUS_BLUETOOTH 0x05
111#define BUS_VIRTUAL 0x06
112#define BUS_ISA 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700113#define BUS_I8042 0x11
114#define BUS_XTKBD 0x12
115#define BUS_RS232 0x13
116#define BUS_GAMEPORT 0x14
Ben Cheng655a7c02013-10-16 16:09:24 -0700117#define BUS_PARPORT 0x15
118#define BUS_AMIGA 0x16
119#define BUS_ADB 0x17
120#define BUS_I2C 0x18
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define BUS_HOST 0x19
122#define BUS_GSC 0x1A
123#define BUS_ATARI 0x1B
124#define BUS_SPI 0x1C
Christopher Ferris106b3a82016-08-24 12:15:38 -0700125#define BUS_RMI 0x1D
126#define BUS_CEC 0x1E
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800127#define BUS_INTEL_ISHTP 0x1F
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700128#define BUS_AMD_SFH 0x20
Christopher Ferris9ce28842018-10-25 12:11:39 -0700129#define MT_TOOL_FINGER 0x00
130#define MT_TOOL_PEN 0x01
131#define MT_TOOL_PALM 0x02
132#define MT_TOOL_DIAL 0x0a
133#define MT_TOOL_MAX 0x0f
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define FF_STATUS_STOPPED 0x00
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800135#define FF_STATUS_PLAYING 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700136#define FF_STATUS_MAX 0x01
137struct ff_replay {
Tao Baod7db5942015-01-28 10:07:51 -0800138 __u16 length;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800139 __u16 delay;
Ben Cheng655a7c02013-10-16 16:09:24 -0700140};
141struct ff_trigger {
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u16 button;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800143 __u16 interval;
Ben Cheng655a7c02013-10-16 16:09:24 -0700144};
145struct ff_envelope {
Tao Baod7db5942015-01-28 10:07:51 -0800146 __u16 attack_length;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800147 __u16 attack_level;
Tao Baod7db5942015-01-28 10:07:51 -0800148 __u16 fade_length;
149 __u16 fade_level;
Ben Cheng655a7c02013-10-16 16:09:24 -0700150};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800151struct ff_constant_effect {
Tao Baod7db5942015-01-28 10:07:51 -0800152 __s16 level;
153 struct ff_envelope envelope;
Ben Cheng655a7c02013-10-16 16:09:24 -0700154};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800155struct ff_ramp_effect {
Tao Baod7db5942015-01-28 10:07:51 -0800156 __s16 start_level;
157 __s16 end_level;
Tao Baod7db5942015-01-28 10:07:51 -0800158 struct ff_envelope envelope;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800159};
Ben Cheng655a7c02013-10-16 16:09:24 -0700160struct ff_condition_effect {
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u16 right_saturation;
Tao Baod7db5942015-01-28 10:07:51 -0800162 __u16 left_saturation;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800163 __s16 right_coeff;
Tao Baod7db5942015-01-28 10:07:51 -0800164 __s16 left_coeff;
165 __u16 deadband;
Tao Baod7db5942015-01-28 10:07:51 -0800166 __s16 center;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800167};
Ben Cheng655a7c02013-10-16 16:09:24 -0700168struct ff_periodic_effect {
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u16 waveform;
Tao Baod7db5942015-01-28 10:07:51 -0800170 __u16 period;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800171 __s16 magnitude;
Tao Baod7db5942015-01-28 10:07:51 -0800172 __s16 offset;
173 __u16 phase;
Tao Baod7db5942015-01-28 10:07:51 -0800174 struct ff_envelope envelope;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800175 __u32 custom_len;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -0700176 __s16 * custom_data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700177};
178struct ff_rumble_effect {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800179 __u16 strong_magnitude;
Tao Baod7db5942015-01-28 10:07:51 -0800180 __u16 weak_magnitude;
Ben Cheng655a7c02013-10-16 16:09:24 -0700181};
182struct ff_effect {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800183 __u16 type;
Tao Baod7db5942015-01-28 10:07:51 -0800184 __s16 id;
185 __u16 direction;
Tao Baod7db5942015-01-28 10:07:51 -0800186 struct ff_trigger trigger;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800187 struct ff_replay replay;
Tao Baod7db5942015-01-28 10:07:51 -0800188 union {
189 struct ff_constant_effect constant;
Tao Baod7db5942015-01-28 10:07:51 -0800190 struct ff_ramp_effect ramp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800191 struct ff_periodic_effect periodic;
Tao Baod7db5942015-01-28 10:07:51 -0800192 struct ff_condition_effect condition[2];
193 struct ff_rumble_effect rumble;
Tao Baod7db5942015-01-28 10:07:51 -0800194 } u;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800195};
Ben Cheng655a7c02013-10-16 16:09:24 -0700196#define FF_RUMBLE 0x50
197#define FF_PERIODIC 0x51
198#define FF_CONSTANT 0x52
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800199#define FF_SPRING 0x53
Ben Cheng655a7c02013-10-16 16:09:24 -0700200#define FF_FRICTION 0x54
201#define FF_DAMPER 0x55
202#define FF_INERTIA 0x56
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800203#define FF_RAMP 0x57
Ben Cheng655a7c02013-10-16 16:09:24 -0700204#define FF_EFFECT_MIN FF_RUMBLE
205#define FF_EFFECT_MAX FF_RAMP
206#define FF_SQUARE 0x58
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800207#define FF_TRIANGLE 0x59
Ben Cheng655a7c02013-10-16 16:09:24 -0700208#define FF_SINE 0x5a
209#define FF_SAW_UP 0x5b
210#define FF_SAW_DOWN 0x5c
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800211#define FF_CUSTOM 0x5d
Ben Cheng655a7c02013-10-16 16:09:24 -0700212#define FF_WAVEFORM_MIN FF_SQUARE
213#define FF_WAVEFORM_MAX FF_CUSTOM
214#define FF_GAIN 0x60
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800215#define FF_AUTOCENTER 0x61
Christopher Ferris05d08e92016-02-04 13:16:38 -0800216#define FF_MAX_EFFECTS FF_GAIN
Ben Cheng655a7c02013-10-16 16:09:24 -0700217#define FF_MAX 0x7f
Christopher Ferris05d08e92016-02-04 13:16:38 -0800218#define FF_CNT (FF_MAX + 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800219#endif