blob: a7553cacbc091cb80d5fd69896f74544d7368ad4 [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_HIDDEV_H
20#define _UAPI_HIDDEV_H
21#include <linux/types.h>
22struct hiddev_event {
Tao Baod7db5942015-01-28 10:07:51 -080023 unsigned hid;
24 signed int value;
Ben Cheng655a7c02013-10-16 16:09:24 -070025};
26struct hiddev_devinfo {
Tao Baod7db5942015-01-28 10:07:51 -080027 __u32 bustype;
28 __u32 busnum;
29 __u32 devnum;
30 __u32 ifnum;
Tao Baod7db5942015-01-28 10:07:51 -080031 __s16 vendor;
32 __s16 product;
33 __s16 version;
34 __u32 num_applications;
Ben Cheng655a7c02013-10-16 16:09:24 -070035};
36struct hiddev_collection_info {
Tao Baod7db5942015-01-28 10:07:51 -080037 __u32 index;
38 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -080039 __u32 usage;
40 __u32 level;
Ben Cheng655a7c02013-10-16 16:09:24 -070041};
42#define HID_STRING_SIZE 256
Ben Cheng655a7c02013-10-16 16:09:24 -070043struct hiddev_string_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -080044 __s32 index;
45 char value[HID_STRING_SIZE];
Ben Cheng655a7c02013-10-16 16:09:24 -070046};
Ben Cheng655a7c02013-10-16 16:09:24 -070047struct hiddev_report_info {
Tao Baod7db5942015-01-28 10:07:51 -080048 __u32 report_type;
49 __u32 report_id;
50 __u32 num_fields;
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
52#define HID_REPORT_ID_UNKNOWN 0xffffffff
53#define HID_REPORT_ID_FIRST 0x00000100
54#define HID_REPORT_ID_NEXT 0x00000200
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define HID_REPORT_ID_MASK 0x000000ff
56#define HID_REPORT_ID_MAX 0x000000ff
57#define HID_REPORT_TYPE_INPUT 1
58#define HID_REPORT_TYPE_OUTPUT 2
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define HID_REPORT_TYPE_FEATURE 3
60#define HID_REPORT_TYPE_MIN 1
61#define HID_REPORT_TYPE_MAX 3
62struct hiddev_field_info {
Tao Baod7db5942015-01-28 10:07:51 -080063 __u32 report_type;
64 __u32 report_id;
65 __u32 field_index;
66 __u32 maxusage;
Tao Baod7db5942015-01-28 10:07:51 -080067 __u32 flags;
68 __u32 physical;
69 __u32 logical;
70 __u32 application;
Tao Baod7db5942015-01-28 10:07:51 -080071 __s32 logical_minimum;
72 __s32 logical_maximum;
73 __s32 physical_minimum;
74 __s32 physical_maximum;
Tao Baod7db5942015-01-28 10:07:51 -080075 __u32 unit_exponent;
76 __u32 unit;
Ben Cheng655a7c02013-10-16 16:09:24 -070077};
78#define HID_FIELD_CONSTANT 0x001
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define HID_FIELD_VARIABLE 0x002
80#define HID_FIELD_RELATIVE 0x004
81#define HID_FIELD_WRAP 0x008
82#define HID_FIELD_NONLINEAR 0x010
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define HID_FIELD_NO_PREFERRED 0x020
84#define HID_FIELD_NULL_STATE 0x040
85#define HID_FIELD_VOLATILE 0x080
86#define HID_FIELD_BUFFERED_BYTE 0x100
Ben Cheng655a7c02013-10-16 16:09:24 -070087struct hiddev_usage_ref {
Tao Baod7db5942015-01-28 10:07:51 -080088 __u32 report_type;
89 __u32 report_id;
90 __u32 field_index;
Tao Baod7db5942015-01-28 10:07:51 -080091 __u32 usage_index;
92 __u32 usage_code;
93 __s32 value;
Ben Cheng655a7c02013-10-16 16:09:24 -070094};
Ben Cheng655a7c02013-10-16 16:09:24 -070095#define HID_MAX_MULTI_USAGES 1024
96struct hiddev_usage_ref_multi {
Tao Baod7db5942015-01-28 10:07:51 -080097 struct hiddev_usage_ref uref;
98 __u32 num_values;
Tao Baod7db5942015-01-28 10:07:51 -080099 __s32 values[HID_MAX_MULTI_USAGES];
Ben Cheng655a7c02013-10-16 16:09:24 -0700100};
101#define HID_FIELD_INDEX_NONE 0xffffffff
102#define HID_VERSION 0x010004
Ben Cheng655a7c02013-10-16 16:09:24 -0700103#define HIDIOCGVERSION _IOR('H', 0x01, int)
104#define HIDIOCAPPLICATION _IO('H', 0x02)
105#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
106#define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor)
Ben Cheng655a7c02013-10-16 16:09:24 -0700107#define HIDIOCINITREPORT _IO('H', 0x05)
108#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
109#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info)
110#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info)
112#define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info)
113#define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref)
114#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref)
116#define HIDIOCGFLAG _IOR('H', 0x0E, int)
117#define HIDIOCSFLAG _IOW('H', 0x0F, int)
118#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info)
120#define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len)
121#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
122#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi)
Ben Cheng655a7c02013-10-16 16:09:24 -0700123#define HIDDEV_FLAG_UREF 0x1
124#define HIDDEV_FLAG_REPORT 0x2
125#define HIDDEV_FLAGS 0x3
126#endif