diff options
Diffstat (limited to 'include/linux/input.h')
-rw-r--r-- | include/linux/input.h | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index 9777668883be..84d4ce0d983a 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 | ||
@@ -758,11 +771,12 @@ struct input_keymap_entry { | |||
758 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 771 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
759 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 772 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
760 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | 773 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ |
774 | #define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ | ||
761 | 775 | ||
762 | #ifdef __KERNEL__ | 776 | #ifdef __KERNEL__ |
763 | /* Implementation details, userspace should not care about these */ | 777 | /* Implementation details, userspace should not care about these */ |
764 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR | 778 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR |
765 | #define ABS_MT_LAST ABS_MT_PRESSURE | 779 | #define ABS_MT_LAST ABS_MT_DISTANCE |
766 | #endif | 780 | #endif |
767 | 781 | ||
768 | #define ABS_MAX 0x3f | 782 | #define ABS_MAX 0x3f |
@@ -873,6 +887,7 @@ struct input_keymap_entry { | |||
873 | */ | 887 | */ |
874 | #define MT_TOOL_FINGER 0 | 888 | #define MT_TOOL_FINGER 0 |
875 | #define MT_TOOL_PEN 1 | 889 | #define MT_TOOL_PEN 1 |
890 | #define MT_TOOL_MAX 1 | ||
876 | 891 | ||
877 | /* | 892 | /* |
878 | * Values describing the status of a force-feedback effect | 893 | * Values describing the status of a force-feedback effect |
@@ -1108,19 +1123,12 @@ struct ff_effect { | |||
1108 | #include <linux/mod_devicetable.h> | 1123 | #include <linux/mod_devicetable.h> |
1109 | 1124 | ||
1110 | /** | 1125 | /** |
1111 | * struct input_mt_slot - represents the state of an input MT slot | ||
1112 | * @abs: holds current values of ABS_MT axes for this slot | ||
1113 | */ | ||
1114 | struct input_mt_slot { | ||
1115 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
1116 | }; | ||
1117 | |||
1118 | /** | ||
1119 | * struct input_dev - represents an input device | 1126 | * struct input_dev - represents an input device |
1120 | * @name: name of the device | 1127 | * @name: name of the device |
1121 | * @phys: physical path to the device in the system hierarchy | 1128 | * @phys: physical path to the device in the system hierarchy |
1122 | * @uniq: unique identification code for the device (if device has it) | 1129 | * @uniq: unique identification code for the device (if device has it) |
1123 | * @id: id of the device (struct input_id) | 1130 | * @id: id of the device (struct input_id) |
1131 | * @propbit: bitmap of device properties and quirks | ||
1124 | * @evbit: bitmap of types of events supported by the device (EV_KEY, | 1132 | * @evbit: bitmap of types of events supported by the device (EV_KEY, |
1125 | * EV_REL, etc.) | 1133 | * EV_REL, etc.) |
1126 | * @keybit: bitmap of keys/buttons this device has | 1134 | * @keybit: bitmap of keys/buttons this device has |
@@ -1155,6 +1163,7 @@ struct input_mt_slot { | |||
1155 | * of tracked contacts | 1163 | * of tracked contacts |
1156 | * @mtsize: number of MT slots the device uses | 1164 | * @mtsize: number of MT slots the device uses |
1157 | * @slot: MT slot currently being transmitted | 1165 | * @slot: MT slot currently being transmitted |
1166 | * @trkid: stores MT tracking ID for the current contact | ||
1158 | * @absinfo: array of &struct input_absinfo elements holding information | 1167 | * @absinfo: array of &struct input_absinfo elements holding information |
1159 | * about absolute axes (current value, min, max, flat, fuzz, | 1168 | * about absolute axes (current value, min, max, flat, fuzz, |
1160 | * resolution) | 1169 | * resolution) |
@@ -1203,6 +1212,8 @@ struct input_dev { | |||
1203 | const char *uniq; | 1212 | const char *uniq; |
1204 | struct input_id id; | 1213 | struct input_id id; |
1205 | 1214 | ||
1215 | unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)]; | ||
1216 | |||
1206 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; | 1217 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; |
1207 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; | 1218 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; |
1208 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; | 1219 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; |
@@ -1239,6 +1250,7 @@ struct input_dev { | |||
1239 | struct input_mt_slot *mt; | 1250 | struct input_mt_slot *mt; |
1240 | int mtsize; | 1251 | int mtsize; |
1241 | int slot; | 1252 | int slot; |
1253 | int trkid; | ||
1242 | 1254 | ||
1243 | struct input_absinfo *absinfo; | 1255 | struct input_absinfo *absinfo; |
1244 | 1256 | ||
@@ -1488,11 +1500,6 @@ static inline void input_mt_sync(struct input_dev *dev) | |||
1488 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); | 1500 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); |
1489 | } | 1501 | } |
1490 | 1502 | ||
1491 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
1492 | { | ||
1493 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
1494 | } | ||
1495 | |||
1496 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); | 1503 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); |
1497 | 1504 | ||
1498 | /** | 1505 | /** |
@@ -1605,8 +1612,5 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file); | |||
1605 | int input_ff_create_memless(struct input_dev *dev, void *data, | 1612 | int input_ff_create_memless(struct input_dev *dev, void *data, |
1606 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); | 1613 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); |
1607 | 1614 | ||
1608 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots); | ||
1609 | void input_mt_destroy_slots(struct input_dev *dev); | ||
1610 | |||
1611 | #endif | 1615 | #endif |
1612 | #endif | 1616 | #endif |