aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/input.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/input.h')
-rw-r--r--include/linux/input.h47
1 files changed, 28 insertions, 19 deletions
diff --git a/include/linux/input.h b/include/linux/input.h
index a8af21d42bc1..e428382ca28a 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -104,12 +104,15 @@ struct input_keymap_entry {
104#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ 104#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
105#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ 105#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
106 106
107#define EVIOCGKEYCODE _IOR('E', 0x04, struct input_keymap_entry) /* get keycode */ 107#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */
108#define EVIOCSKEYCODE _IOW('E', 0x04, struct input_keymap_entry) /* set keycode */ 108#define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry)
109#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */
110#define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry)
109 111
110#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ 112#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
111#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ 113#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
112#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ 114#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
115#define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) /* get device properties */
113 116
114#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */ 117#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */
115#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ 118#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
@@ -127,6 +130,18 @@ struct input_keymap_entry {
127#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ 130#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
128 131
129/* 132/*
133 * Device properties and quirks
134 */
135
136#define INPUT_PROP_POINTER 0x00 /* needs a pointer */
137#define INPUT_PROP_DIRECT 0x01 /* direct input devices */
138#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */
139#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */
140
141#define INPUT_PROP_MAX 0x1f
142#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
143
144/*
130 * Event types 145 * Event types
131 */ 146 */
132 147
@@ -588,6 +603,8 @@ struct input_keymap_entry {
588#define KEY_FRAMEFORWARD 0x1b5 603#define KEY_FRAMEFORWARD 0x1b5
589#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ 604#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
590#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ 605#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
606#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
607#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
591 608
592#define KEY_DEL_EOL 0x1c0 609#define KEY_DEL_EOL 0x1c0
593#define KEY_DEL_EOS 0x1c1 610#define KEY_DEL_EOS 0x1c1
@@ -756,11 +773,12 @@ struct input_keymap_entry {
756#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ 773#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
757#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ 774#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
758#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ 775#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
776#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */
759 777
760#ifdef __KERNEL__ 778#ifdef __KERNEL__
761/* Implementation details, userspace should not care about these */ 779/* Implementation details, userspace should not care about these */
762#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR 780#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR
763#define ABS_MT_LAST ABS_MT_PRESSURE 781#define ABS_MT_LAST ABS_MT_DISTANCE
764#endif 782#endif
765 783
766#define ABS_MAX 0x3f 784#define ABS_MAX 0x3f
@@ -784,6 +802,7 @@ struct input_keymap_entry {
784#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ 802#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */
785#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ 803#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */
786#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ 804#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */
805#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */
787#define SW_MAX 0x0f 806#define SW_MAX 0x0f
788#define SW_CNT (SW_MAX+1) 807#define SW_CNT (SW_MAX+1)
789 808
@@ -871,6 +890,7 @@ struct input_keymap_entry {
871 */ 890 */
872#define MT_TOOL_FINGER 0 891#define MT_TOOL_FINGER 0
873#define MT_TOOL_PEN 1 892#define MT_TOOL_PEN 1
893#define MT_TOOL_MAX 1
874 894
875/* 895/*
876 * Values describing the status of a force-feedback effect 896 * Values describing the status of a force-feedback effect
@@ -1106,19 +1126,12 @@ struct ff_effect {
1106#include <linux/mod_devicetable.h> 1126#include <linux/mod_devicetable.h>
1107 1127
1108/** 1128/**
1109 * struct input_mt_slot - represents the state of an input MT slot
1110 * @abs: holds current values of ABS_MT axes for this slot
1111 */
1112struct input_mt_slot {
1113 int abs[ABS_MT_LAST - ABS_MT_FIRST + 1];
1114};
1115
1116/**
1117 * struct input_dev - represents an input device 1129 * struct input_dev - represents an input device
1118 * @name: name of the device 1130 * @name: name of the device
1119 * @phys: physical path to the device in the system hierarchy 1131 * @phys: physical path to the device in the system hierarchy
1120 * @uniq: unique identification code for the device (if device has it) 1132 * @uniq: unique identification code for the device (if device has it)
1121 * @id: id of the device (struct input_id) 1133 * @id: id of the device (struct input_id)
1134 * @propbit: bitmap of device properties and quirks
1122 * @evbit: bitmap of types of events supported by the device (EV_KEY, 1135 * @evbit: bitmap of types of events supported by the device (EV_KEY,
1123 * EV_REL, etc.) 1136 * EV_REL, etc.)
1124 * @keybit: bitmap of keys/buttons this device has 1137 * @keybit: bitmap of keys/buttons this device has
@@ -1153,6 +1166,7 @@ struct input_mt_slot {
1153 * of tracked contacts 1166 * of tracked contacts
1154 * @mtsize: number of MT slots the device uses 1167 * @mtsize: number of MT slots the device uses
1155 * @slot: MT slot currently being transmitted 1168 * @slot: MT slot currently being transmitted
1169 * @trkid: stores MT tracking ID for the current contact
1156 * @absinfo: array of &struct input_absinfo elements holding information 1170 * @absinfo: array of &struct input_absinfo elements holding information
1157 * about absolute axes (current value, min, max, flat, fuzz, 1171 * about absolute axes (current value, min, max, flat, fuzz,
1158 * resolution) 1172 * resolution)
@@ -1201,6 +1215,8 @@ struct input_dev {
1201 const char *uniq; 1215 const char *uniq;
1202 struct input_id id; 1216 struct input_id id;
1203 1217
1218 unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)];
1219
1204 unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; 1220 unsigned long evbit[BITS_TO_LONGS(EV_CNT)];
1205 unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; 1221 unsigned long keybit[BITS_TO_LONGS(KEY_CNT)];
1206 unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; 1222 unsigned long relbit[BITS_TO_LONGS(REL_CNT)];
@@ -1237,6 +1253,7 @@ struct input_dev {
1237 struct input_mt_slot *mt; 1253 struct input_mt_slot *mt;
1238 int mtsize; 1254 int mtsize;
1239 int slot; 1255 int slot;
1256 int trkid;
1240 1257
1241 struct input_absinfo *absinfo; 1258 struct input_absinfo *absinfo;
1242 1259
@@ -1486,11 +1503,6 @@ static inline void input_mt_sync(struct input_dev *dev)
1486 input_event(dev, EV_SYN, SYN_MT_REPORT, 0); 1503 input_event(dev, EV_SYN, SYN_MT_REPORT, 0);
1487} 1504}
1488 1505
1489static inline void input_mt_slot(struct input_dev *dev, int slot)
1490{
1491 input_event(dev, EV_ABS, ABS_MT_SLOT, slot);
1492}
1493
1494void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); 1506void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
1495 1507
1496/** 1508/**
@@ -1603,8 +1615,5 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file);
1603int input_ff_create_memless(struct input_dev *dev, void *data, 1615int input_ff_create_memless(struct input_dev *dev, void *data,
1604 int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); 1616 int (*play_effect)(struct input_dev *, void *, struct ff_effect *));
1605 1617
1606int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots);
1607void input_mt_destroy_slots(struct input_dev *dev);
1608
1609#endif 1618#endif
1610#endif 1619#endif