122851890Sopenharmony_ci/****************************************************************************
222851890Sopenharmony_ci ****************************************************************************
322851890Sopenharmony_ci ***
422851890Sopenharmony_ci ***   This header was automatically generated from a Linux kernel header
522851890Sopenharmony_ci ***   of the same name, to make information necessary for userspace to
622851890Sopenharmony_ci ***   call into the kernel available to libc.  It contains only constants,
722851890Sopenharmony_ci ***   structures, and macros generated from the original header, and thus,
822851890Sopenharmony_ci ***   contains no copyrightable information.
922851890Sopenharmony_ci ***
1022851890Sopenharmony_ci ***   To edit the content of this header, modify the corresponding
1122851890Sopenharmony_ci ***   source file (e.g. under external/kernel-headers/original/) then
1222851890Sopenharmony_ci ***   run bionic/libc/kernel/tools/update_all.py
1322851890Sopenharmony_ci ***
1422851890Sopenharmony_ci ***   Any manual change here will be lost the next time this script will
1522851890Sopenharmony_ci ***   be run. You've been warned!
1622851890Sopenharmony_ci ***
1722851890Sopenharmony_ci ****************************************************************************
1822851890Sopenharmony_ci ****************************************************************************/
1922851890Sopenharmony_ci#ifndef _UAPI_INPUT_H
2022851890Sopenharmony_ci#define _UAPI_INPUT_H
2122851890Sopenharmony_ci#include <sys/time.h>
2222851890Sopenharmony_ci#include <sys/ioctl.h>
2322851890Sopenharmony_ci#include <sys/types.h>
2422851890Sopenharmony_ci#include <linux/types.h>
2522851890Sopenharmony_ci#include "input-event-codes.h"
2622851890Sopenharmony_cistruct input_event {
2722851890Sopenharmony_ci#if __BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)
2822851890Sopenharmony_ci  struct timeval time;
2922851890Sopenharmony_ci#define input_event_sec time.tv_sec
3022851890Sopenharmony_ci#define input_event_usec time.tv_usec
3122851890Sopenharmony_ci#else
3222851890Sopenharmony_ci  __kernel_ulong_t __sec;
3322851890Sopenharmony_ci#if defined(__sparc__) && defined(__arch64__)
3422851890Sopenharmony_ci  unsigned int __usec;
3522851890Sopenharmony_ci  unsigned int __pad;
3622851890Sopenharmony_ci#else
3722851890Sopenharmony_ci  __kernel_ulong_t __usec;
3822851890Sopenharmony_ci#endif
3922851890Sopenharmony_ci#define input_event_sec __sec
4022851890Sopenharmony_ci#define input_event_usec __usec
4122851890Sopenharmony_ci#endif
4222851890Sopenharmony_ci  __u16 type;
4322851890Sopenharmony_ci  __u16 code;
4422851890Sopenharmony_ci  __s32 value;
4522851890Sopenharmony_ci};
4622851890Sopenharmony_ci#define EV_VERSION 0x010001
4722851890Sopenharmony_cistruct input_id {
4822851890Sopenharmony_ci  __u16 bustype;
4922851890Sopenharmony_ci  __u16 vendor;
5022851890Sopenharmony_ci  __u16 product;
5122851890Sopenharmony_ci  __u16 version;
5222851890Sopenharmony_ci};
5322851890Sopenharmony_cistruct input_absinfo {
5422851890Sopenharmony_ci  __s32 value;
5522851890Sopenharmony_ci  __s32 minimum;
5622851890Sopenharmony_ci  __s32 maximum;
5722851890Sopenharmony_ci  __s32 fuzz;
5822851890Sopenharmony_ci  __s32 flat;
5922851890Sopenharmony_ci  __s32 resolution;
6022851890Sopenharmony_ci};
6122851890Sopenharmony_cistruct input_keymap_entry {
6222851890Sopenharmony_ci#define INPUT_KEYMAP_BY_INDEX (1 << 0)
6322851890Sopenharmony_ci  __u8 flags;
6422851890Sopenharmony_ci  __u8 len;
6522851890Sopenharmony_ci  __u16 index;
6622851890Sopenharmony_ci  __u32 keycode;
6722851890Sopenharmony_ci  __u8 scancode[32];
6822851890Sopenharmony_ci};
6922851890Sopenharmony_cistruct input_mask {
7022851890Sopenharmony_ci  __u32 type;
7122851890Sopenharmony_ci  __u32 codes_size;
7222851890Sopenharmony_ci  __u64 codes_ptr;
7322851890Sopenharmony_ci};
7422851890Sopenharmony_ci#define EVIOCGVERSION _IOR('E', 0x01, int)
7522851890Sopenharmony_ci#define EVIOCGID _IOR('E', 0x02, struct input_id)
7622851890Sopenharmony_ci#define EVIOCGREP _IOR('E', 0x03, unsigned int[2])
7722851890Sopenharmony_ci#define EVIOCSREP _IOW('E', 0x03, unsigned int[2])
7822851890Sopenharmony_ci#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2])
7922851890Sopenharmony_ci#define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry)
8022851890Sopenharmony_ci#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2])
8122851890Sopenharmony_ci#define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry)
8222851890Sopenharmony_ci#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len)
8322851890Sopenharmony_ci#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len)
8422851890Sopenharmony_ci#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len)
8522851890Sopenharmony_ci#define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len)
8622851890Sopenharmony_ci#define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len)
8722851890Sopenharmony_ci#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len)
8822851890Sopenharmony_ci#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len)
8922851890Sopenharmony_ci#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len)
9022851890Sopenharmony_ci#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len)
9122851890Sopenharmony_ci#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len)
9222851890Sopenharmony_ci#define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo)
9322851890Sopenharmony_ci#define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo)
9422851890Sopenharmony_ci#define EVIOCSFF _IOW('E', 0x80, struct ff_effect)
9522851890Sopenharmony_ci#define EVIOCRMFF _IOW('E', 0x81, int)
9622851890Sopenharmony_ci#define EVIOCGEFFECTS _IOR('E', 0x84, int)
9722851890Sopenharmony_ci#define EVIOCGRAB _IOW('E', 0x90, int)
9822851890Sopenharmony_ci#define EVIOCREVOKE _IOW('E', 0x91, int)
9922851890Sopenharmony_ci#define EVIOCGMASK _IOR('E', 0x92, struct input_mask)
10022851890Sopenharmony_ci#define EVIOCSMASK _IOW('E', 0x93, struct input_mask)
10122851890Sopenharmony_ci#define EVIOCSCLOCKID _IOW('E', 0xa0, int)
10222851890Sopenharmony_ci#define ID_BUS 0
10322851890Sopenharmony_ci#define ID_VENDOR 1
10422851890Sopenharmony_ci#define ID_PRODUCT 2
10522851890Sopenharmony_ci#define ID_VERSION 3
10622851890Sopenharmony_ci#define BUS_PCI 0x01
10722851890Sopenharmony_ci#define BUS_ISAPNP 0x02
10822851890Sopenharmony_ci#define BUS_USB 0x03
10922851890Sopenharmony_ci#define BUS_HIL 0x04
11022851890Sopenharmony_ci#define BUS_BLUETOOTH 0x05
11122851890Sopenharmony_ci#define BUS_VIRTUAL 0x06
11222851890Sopenharmony_ci#define BUS_ISA 0x10
11322851890Sopenharmony_ci#define BUS_I8042 0x11
11422851890Sopenharmony_ci#define BUS_XTKBD 0x12
11522851890Sopenharmony_ci#define BUS_RS232 0x13
11622851890Sopenharmony_ci#define BUS_GAMEPORT 0x14
11722851890Sopenharmony_ci#define BUS_PARPORT 0x15
11822851890Sopenharmony_ci#define BUS_AMIGA 0x16
11922851890Sopenharmony_ci#define BUS_ADB 0x17
12022851890Sopenharmony_ci#define BUS_I2C 0x18
12122851890Sopenharmony_ci#define BUS_HOST 0x19
12222851890Sopenharmony_ci#define BUS_GSC 0x1A
12322851890Sopenharmony_ci#define BUS_ATARI 0x1B
12422851890Sopenharmony_ci#define BUS_SPI 0x1C
12522851890Sopenharmony_ci#define BUS_RMI 0x1D
12622851890Sopenharmony_ci#define BUS_CEC 0x1E
12722851890Sopenharmony_ci#define BUS_INTEL_ISHTP 0x1F
12822851890Sopenharmony_ci#define MT_TOOL_FINGER 0x00
12922851890Sopenharmony_ci#define MT_TOOL_PEN 0x01
13022851890Sopenharmony_ci#define MT_TOOL_PALM 0x02
13122851890Sopenharmony_ci#define MT_TOOL_DIAL 0x0a
13222851890Sopenharmony_ci#define MT_TOOL_MAX 0x0f
13322851890Sopenharmony_ci#define FF_STATUS_STOPPED 0x00
13422851890Sopenharmony_ci#define FF_STATUS_PLAYING 0x01
13522851890Sopenharmony_ci#define FF_STATUS_MAX 0x01
13622851890Sopenharmony_cistruct ff_replay {
13722851890Sopenharmony_ci  __u16 length;
13822851890Sopenharmony_ci  __u16 delay;
13922851890Sopenharmony_ci};
14022851890Sopenharmony_cistruct ff_trigger {
14122851890Sopenharmony_ci  __u16 button;
14222851890Sopenharmony_ci  __u16 interval;
14322851890Sopenharmony_ci};
14422851890Sopenharmony_cistruct ff_envelope {
14522851890Sopenharmony_ci  __u16 attack_length;
14622851890Sopenharmony_ci  __u16 attack_level;
14722851890Sopenharmony_ci  __u16 fade_length;
14822851890Sopenharmony_ci  __u16 fade_level;
14922851890Sopenharmony_ci};
15022851890Sopenharmony_cistruct ff_constant_effect {
15122851890Sopenharmony_ci  __s16 level;
15222851890Sopenharmony_ci  struct ff_envelope envelope;
15322851890Sopenharmony_ci};
15422851890Sopenharmony_cistruct ff_ramp_effect {
15522851890Sopenharmony_ci  __s16 start_level;
15622851890Sopenharmony_ci  __s16 end_level;
15722851890Sopenharmony_ci  struct ff_envelope envelope;
15822851890Sopenharmony_ci};
15922851890Sopenharmony_cistruct ff_condition_effect {
16022851890Sopenharmony_ci  __u16 right_saturation;
16122851890Sopenharmony_ci  __u16 left_saturation;
16222851890Sopenharmony_ci  __s16 right_coeff;
16322851890Sopenharmony_ci  __s16 left_coeff;
16422851890Sopenharmony_ci  __u16 deadband;
16522851890Sopenharmony_ci  __s16 center;
16622851890Sopenharmony_ci};
16722851890Sopenharmony_cistruct ff_periodic_effect {
16822851890Sopenharmony_ci  __u16 waveform;
16922851890Sopenharmony_ci  __u16 period;
17022851890Sopenharmony_ci  __s16 magnitude;
17122851890Sopenharmony_ci  __s16 offset;
17222851890Sopenharmony_ci  __u16 phase;
17322851890Sopenharmony_ci  struct ff_envelope envelope;
17422851890Sopenharmony_ci  __u32 custom_len;
17522851890Sopenharmony_ci  __s16 __user * custom_data;
17622851890Sopenharmony_ci};
17722851890Sopenharmony_cistruct ff_rumble_effect {
17822851890Sopenharmony_ci  __u16 strong_magnitude;
17922851890Sopenharmony_ci  __u16 weak_magnitude;
18022851890Sopenharmony_ci};
18122851890Sopenharmony_cistruct ff_effect {
18222851890Sopenharmony_ci  __u16 type;
18322851890Sopenharmony_ci  __s16 id;
18422851890Sopenharmony_ci  __u16 direction;
18522851890Sopenharmony_ci  struct ff_trigger trigger;
18622851890Sopenharmony_ci  struct ff_replay replay;
18722851890Sopenharmony_ci  union {
18822851890Sopenharmony_ci    struct ff_constant_effect constant;
18922851890Sopenharmony_ci    struct ff_ramp_effect ramp;
19022851890Sopenharmony_ci    struct ff_periodic_effect periodic;
19122851890Sopenharmony_ci    struct ff_condition_effect condition[2];
19222851890Sopenharmony_ci    struct ff_rumble_effect rumble;
19322851890Sopenharmony_ci  } u;
19422851890Sopenharmony_ci};
19522851890Sopenharmony_ci#define FF_RUMBLE 0x50
19622851890Sopenharmony_ci#define FF_PERIODIC 0x51
19722851890Sopenharmony_ci#define FF_CONSTANT 0x52
19822851890Sopenharmony_ci#define FF_SPRING 0x53
19922851890Sopenharmony_ci#define FF_FRICTION 0x54
20022851890Sopenharmony_ci#define FF_DAMPER 0x55
20122851890Sopenharmony_ci#define FF_INERTIA 0x56
20222851890Sopenharmony_ci#define FF_RAMP 0x57
20322851890Sopenharmony_ci#define FF_EFFECT_MIN FF_RUMBLE
20422851890Sopenharmony_ci#define FF_EFFECT_MAX FF_RAMP
20522851890Sopenharmony_ci#define FF_SQUARE 0x58
20622851890Sopenharmony_ci#define FF_TRIANGLE 0x59
20722851890Sopenharmony_ci#define FF_SINE 0x5a
20822851890Sopenharmony_ci#define FF_SAW_UP 0x5b
20922851890Sopenharmony_ci#define FF_SAW_DOWN 0x5c
21022851890Sopenharmony_ci#define FF_CUSTOM 0x5d
21122851890Sopenharmony_ci#define FF_WAVEFORM_MIN FF_SQUARE
21222851890Sopenharmony_ci#define FF_WAVEFORM_MAX FF_CUSTOM
21322851890Sopenharmony_ci#define FF_GAIN 0x60
21422851890Sopenharmony_ci#define FF_AUTOCENTER 0x61
21522851890Sopenharmony_ci#define FF_MAX_EFFECTS FF_GAIN
21622851890Sopenharmony_ci#define FF_MAX 0x7f
21722851890Sopenharmony_ci#define FF_CNT (FF_MAX + 1)
21822851890Sopenharmony_ci#endif
219