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.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/include/linux/input.h b/include/linux/input.h
index f7a6e1966df3..c4e9d91ec979 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -112,6 +112,7 @@ struct input_keymap_entry {
112#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 */
113#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 */
114#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 */
115 116
116#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 */
117#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 */
@@ -129,6 +130,18 @@ struct input_keymap_entry {
129#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ 130#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
130 131
131/* 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/*
132 * Event types 145 * Event types
133 */ 146 */
134 147
@@ -760,11 +773,12 @@ struct input_keymap_entry {
760#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 */
761#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ 774#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
762#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 */
763 777
764#ifdef __KERNEL__ 778#ifdef __KERNEL__
765/* Implementation details, userspace should not care about these */ 779/* Implementation details, userspace should not care about these */
766#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR 780#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR
767#define ABS_MT_LAST ABS_MT_PRESSURE 781#define ABS_MT_LAST ABS_MT_DISTANCE
768#endif 782#endif
769 783
770#define ABS_MAX 0x3f 784#define ABS_MAX 0x3f
@@ -875,6 +889,7 @@ struct input_keymap_entry {
875 */ 889 */
876#define MT_TOOL_FINGER 0 890#define MT_TOOL_FINGER 0
877#define MT_TOOL_PEN 1 891#define MT_TOOL_PEN 1
892#define MT_TOOL_MAX 1
878 893
879/* 894/*
880 * Values describing the status of a force-feedback effect 895 * Values describing the status of a force-feedback effect
@@ -1110,19 +1125,12 @@ struct ff_effect {
1110#include <linux/mod_devicetable.h> 1125#include <linux/mod_devicetable.h>
1111 1126
1112/** 1127/**
1113 * struct input_mt_slot - represents the state of an input MT slot
1114 * @abs: holds current values of ABS_MT axes for this slot
1115 */
1116struct input_mt_slot {
1117 int abs[ABS_MT_LAST - ABS_MT_FIRST + 1];
1118};
1119
1120/**
1121 * struct input_dev - represents an input device 1128 * struct input_dev - represents an input device
1122 * @name: name of the device 1129 * @name: name of the device
1123 * @phys: physical path to the device in the system hierarchy 1130 * @phys: physical path to the device in the system hierarchy
1124 * @uniq: unique identification code for the device (if device has it) 1131 * @uniq: unique identification code for the device (if device has it)
1125 * @id: id of the device (struct input_id) 1132 * @id: id of the device (struct input_id)
1133 * @propbit: bitmap of device properties and quirks
1126 * @evbit: bitmap of types of events supported by the device (EV_KEY, 1134 * @evbit: bitmap of types of events supported by the device (EV_KEY,
1127 * EV_REL, etc.) 1135 * EV_REL, etc.)
1128 * @keybit: bitmap of keys/buttons this device has 1136 * @keybit: bitmap of keys/buttons this device has
@@ -1157,6 +1165,7 @@ struct input_mt_slot {
1157 * of tracked contacts 1165 * of tracked contacts
1158 * @mtsize: number of MT slots the device uses 1166 * @mtsize: number of MT slots the device uses
1159 * @slot: MT slot currently being transmitted 1167 * @slot: MT slot currently being transmitted
1168 * @trkid: stores MT tracking ID for the current contact
1160 * @absinfo: array of &struct input_absinfo elements holding information 1169 * @absinfo: array of &struct input_absinfo elements holding information
1161 * about absolute axes (current value, min, max, flat, fuzz, 1170 * about absolute axes (current value, min, max, flat, fuzz,
1162 * resolution) 1171 * resolution)
@@ -1205,6 +1214,8 @@ struct input_dev {
1205 const char *uniq; 1214 const char *uniq;
1206 struct input_id id; 1215 struct input_id id;
1207 1216
1217 unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)];
1218
1208 unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; 1219 unsigned long evbit[BITS_TO_LONGS(EV_CNT)];
1209 unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; 1220 unsigned long keybit[BITS_TO_LONGS(KEY_CNT)];
1210 unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; 1221 unsigned long relbit[BITS_TO_LONGS(REL_CNT)];
@@ -1241,6 +1252,7 @@ struct input_dev {
1241 struct input_mt_slot *mt; 1252 struct input_mt_slot *mt;
1242 int mtsize; 1253 int mtsize;
1243 int slot; 1254 int slot;
1255 int trkid;
1244 1256
1245 struct input_absinfo *absinfo; 1257 struct input_absinfo *absinfo;
1246 1258
@@ -1490,11 +1502,6 @@ static inline void input_mt_sync(struct input_dev *dev)
1490 input_event(dev, EV_SYN, SYN_MT_REPORT, 0); 1502 input_event(dev, EV_SYN, SYN_MT_REPORT, 0);
1491} 1503}
1492 1504
1493static inline void input_mt_slot(struct input_dev *dev, int slot)
1494{
1495 input_event(dev, EV_ABS, ABS_MT_SLOT, slot);
1496}
1497
1498void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); 1505void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
1499 1506
1500/** 1507/**
@@ -1607,8 +1614,5 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file);
1607int input_ff_create_memless(struct input_dev *dev, void *data, 1614int input_ff_create_memless(struct input_dev *dev, void *data,
1608 int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); 1615 int (*play_effect)(struct input_dev *, void *, struct ff_effect *));
1609 1616
1610int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots);
1611void input_mt_destroy_slots(struct input_dev *dev);
1612
1613#endif 1617#endif
1614#endif 1618#endif