blob: 69952efda8bc79fc394e0c12825a260dfd865f02 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_LINUX_JOYSTICK_H
8#define _UAPI_LINUX_JOYSTICK_H
9#include <linux/types.h>
10#include <linux/input.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define JS_VERSION 0x020100
12#define JS_EVENT_BUTTON 0x01
13#define JS_EVENT_AXIS 0x02
14#define JS_EVENT_INIT 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -070015struct js_event {
Tao Baod7db5942015-01-28 10:07:51 -080016 __u32 time;
17 __s16 value;
18 __u8 type;
Tao Baod7db5942015-01-28 10:07:51 -080019 __u8 number;
Ben Cheng655a7c02013-10-16 16:09:24 -070020};
21#define JSIOCGVERSION _IOR('j', 0x01, __u32)
22#define JSIOCGAXES _IOR('j', 0x11, __u8)
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define JSIOCGBUTTONS _IOR('j', 0x12, __u8)
24#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len)
25#define JSIOCSCORR _IOW('j', 0x21, struct js_corr)
26#define JSIOCGCORR _IOR('j', 0x22, struct js_corr)
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT])
28#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT])
29#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1])
30#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1])
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define JS_CORR_NONE 0x00
32#define JS_CORR_BROKEN 0x01
33struct js_corr {
Tao Baod7db5942015-01-28 10:07:51 -080034 __s32 coef[8];
Tao Baod7db5942015-01-28 10:07:51 -080035 __s16 prec;
36 __u16 type;
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
38#define JS_RETURN sizeof(struct JS_DATA_TYPE)
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define JS_TRUE 1
40#define JS_FALSE 0
41#define JS_X_0 0x01
42#define JS_Y_0 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define JS_X_1 0x04
44#define JS_Y_1 0x08
45#define JS_MAX 2
46#define JS_DEF_TIMEOUT 0x1300
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define JS_DEF_CORR 0
48#define JS_DEF_TIMELIMIT 10L
49#define JS_SET_CAL 1
50#define JS_GET_CAL 2
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define JS_SET_TIMEOUT 3
52#define JS_GET_TIMEOUT 4
53#define JS_SET_TIMELIMIT 5
54#define JS_GET_TIMELIMIT 6
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define JS_GET_ALL 7
56#define JS_SET_ALL 8
57struct JS_DATA_TYPE {
Tao Baod7db5942015-01-28 10:07:51 -080058 __s32 buttons;
Tao Baod7db5942015-01-28 10:07:51 -080059 __s32 x;
60 __s32 y;
Ben Cheng655a7c02013-10-16 16:09:24 -070061};
62struct JS_DATA_SAVE_TYPE_32 {
Tao Baod7db5942015-01-28 10:07:51 -080063 __s32 JS_TIMEOUT;
64 __s32 BUSY;
65 __s32 JS_EXPIRETIME;
66 __s32 JS_TIMELIMIT;
Tao Baod7db5942015-01-28 10:07:51 -080067 struct JS_DATA_TYPE JS_SAVE;
68 struct JS_DATA_TYPE JS_CORR;
Ben Cheng655a7c02013-10-16 16:09:24 -070069};
70struct JS_DATA_SAVE_TYPE_64 {
Tao Baod7db5942015-01-28 10:07:51 -080071 __s32 JS_TIMEOUT;
72 __s32 BUSY;
73 __s64 JS_EXPIRETIME;
74 __s64 JS_TIMELIMIT;
Tao Baod7db5942015-01-28 10:07:51 -080075 struct JS_DATA_TYPE JS_SAVE;
76 struct JS_DATA_TYPE JS_CORR;
Ben Cheng655a7c02013-10-16 16:09:24 -070077};
78#endif