blob: 3f16f1169079674a6258cfcea3b9af324918f4c4 [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_LINUX_JOYSTICK_H
20#define _UAPI_LINUX_JOYSTICK_H
21#include <linux/types.h>
22#include <linux/input.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define JS_VERSION 0x020100
24#define JS_EVENT_BUTTON 0x01
25#define JS_EVENT_AXIS 0x02
26#define JS_EVENT_INIT 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -070027struct js_event {
Tao Baod7db5942015-01-28 10:07:51 -080028 __u32 time;
29 __s16 value;
30 __u8 type;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u8 number;
Ben Cheng655a7c02013-10-16 16:09:24 -070032};
33#define JSIOCGVERSION _IOR('j', 0x01, __u32)
34#define JSIOCGAXES _IOR('j', 0x11, __u8)
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define JSIOCGBUTTONS _IOR('j', 0x12, __u8)
36#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len)
37#define JSIOCSCORR _IOW('j', 0x21, struct js_corr)
38#define JSIOCGCORR _IOR('j', 0x22, struct js_corr)
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT])
40#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT])
41#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1])
42#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1])
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define JS_CORR_NONE 0x00
44#define JS_CORR_BROKEN 0x01
45struct js_corr {
Tao Baod7db5942015-01-28 10:07:51 -080046 __s32 coef[8];
Tao Baod7db5942015-01-28 10:07:51 -080047 __s16 prec;
48 __u16 type;
Ben Cheng655a7c02013-10-16 16:09:24 -070049};
50#define JS_RETURN sizeof(struct JS_DATA_TYPE)
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define JS_TRUE 1
52#define JS_FALSE 0
53#define JS_X_0 0x01
54#define JS_Y_0 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define JS_X_1 0x04
56#define JS_Y_1 0x08
57#define JS_MAX 2
58#define JS_DEF_TIMEOUT 0x1300
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define JS_DEF_CORR 0
60#define JS_DEF_TIMELIMIT 10L
61#define JS_SET_CAL 1
62#define JS_GET_CAL 2
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define JS_SET_TIMEOUT 3
64#define JS_GET_TIMEOUT 4
65#define JS_SET_TIMELIMIT 5
66#define JS_GET_TIMELIMIT 6
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define JS_GET_ALL 7
68#define JS_SET_ALL 8
69struct JS_DATA_TYPE {
Tao Baod7db5942015-01-28 10:07:51 -080070 __s32 buttons;
Tao Baod7db5942015-01-28 10:07:51 -080071 __s32 x;
72 __s32 y;
Ben Cheng655a7c02013-10-16 16:09:24 -070073};
74struct JS_DATA_SAVE_TYPE_32 {
Tao Baod7db5942015-01-28 10:07:51 -080075 __s32 JS_TIMEOUT;
76 __s32 BUSY;
77 __s32 JS_EXPIRETIME;
78 __s32 JS_TIMELIMIT;
Tao Baod7db5942015-01-28 10:07:51 -080079 struct JS_DATA_TYPE JS_SAVE;
80 struct JS_DATA_TYPE JS_CORR;
Ben Cheng655a7c02013-10-16 16:09:24 -070081};
82struct JS_DATA_SAVE_TYPE_64 {
Tao Baod7db5942015-01-28 10:07:51 -080083 __s32 JS_TIMEOUT;
84 __s32 BUSY;
85 __s64 JS_EXPIRETIME;
86 __s64 JS_TIMELIMIT;
Tao Baod7db5942015-01-28 10:07:51 -080087 struct JS_DATA_TYPE JS_SAVE;
88 struct JS_DATA_TYPE JS_CORR;
Ben Cheng655a7c02013-10-16 16:09:24 -070089};
90#endif