diff options
Diffstat (limited to 'include/linux/input.h')
| -rw-r--r-- | include/linux/input.h | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index 725dcd0f63a4..15464ba6bf53 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -1169,6 +1169,18 @@ struct ff_effect { | |||
| 1169 | #include <linux/mod_devicetable.h> | 1169 | #include <linux/mod_devicetable.h> |
| 1170 | 1170 | ||
| 1171 | /** | 1171 | /** |
| 1172 | * struct input_value - input value representation | ||
| 1173 | * @type: type of value (EV_KEY, EV_ABS, etc) | ||
| 1174 | * @code: the value code | ||
| 1175 | * @value: the value | ||
| 1176 | */ | ||
| 1177 | struct input_value { | ||
| 1178 | __u16 type; | ||
| 1179 | __u16 code; | ||
| 1180 | __s32 value; | ||
| 1181 | }; | ||
| 1182 | |||
| 1183 | /** | ||
| 1172 | * struct input_dev - represents an input device | 1184 | * struct input_dev - represents an input device |
| 1173 | * @name: name of the device | 1185 | * @name: name of the device |
| 1174 | * @phys: physical path to the device in the system hierarchy | 1186 | * @phys: physical path to the device in the system hierarchy |
| @@ -1203,11 +1215,7 @@ struct ff_effect { | |||
| 1203 | * software autorepeat | 1215 | * software autorepeat |
| 1204 | * @timer: timer for software autorepeat | 1216 | * @timer: timer for software autorepeat |
| 1205 | * @rep: current values for autorepeat parameters (delay, rate) | 1217 | * @rep: current values for autorepeat parameters (delay, rate) |
| 1206 | * @mt: pointer to array of struct input_mt_slot holding current values | 1218 | * @mt: pointer to multitouch state |
| 1207 | * of tracked contacts | ||
| 1208 | * @mtsize: number of MT slots the device uses | ||
| 1209 | * @slot: MT slot currently being transmitted | ||
| 1210 | * @trkid: stores MT tracking ID for the current contact | ||
| 1211 | * @absinfo: array of &struct input_absinfo elements holding information | 1219 | * @absinfo: array of &struct input_absinfo elements holding information |
| 1212 | * about absolute axes (current value, min, max, flat, fuzz, | 1220 | * about absolute axes (current value, min, max, flat, fuzz, |
| 1213 | * resolution) | 1221 | * resolution) |
| @@ -1244,7 +1252,6 @@ struct ff_effect { | |||
| 1244 | * last user closes the device | 1252 | * last user closes the device |
| 1245 | * @going_away: marks devices that are in a middle of unregistering and | 1253 | * @going_away: marks devices that are in a middle of unregistering and |
| 1246 | * causes input_open_device*() fail with -ENODEV. | 1254 | * causes input_open_device*() fail with -ENODEV. |
| 1247 | * @sync: set to %true when there were no new events since last EV_SYN | ||
| 1248 | * @dev: driver model's view of this device | 1255 | * @dev: driver model's view of this device |
| 1249 | * @h_list: list of input handles associated with the device. When | 1256 | * @h_list: list of input handles associated with the device. When |
| 1250 | * accessing the list dev->mutex must be held | 1257 | * accessing the list dev->mutex must be held |
| @@ -1287,10 +1294,7 @@ struct input_dev { | |||
| 1287 | 1294 | ||
| 1288 | int rep[REP_CNT]; | 1295 | int rep[REP_CNT]; |
| 1289 | 1296 | ||
| 1290 | struct input_mt_slot *mt; | 1297 | struct input_mt *mt; |
| 1291 | int mtsize; | ||
| 1292 | int slot; | ||
| 1293 | int trkid; | ||
| 1294 | 1298 | ||
| 1295 | struct input_absinfo *absinfo; | 1299 | struct input_absinfo *absinfo; |
| 1296 | 1300 | ||
| @@ -1312,12 +1316,14 @@ struct input_dev { | |||
| 1312 | unsigned int users; | 1316 | unsigned int users; |
| 1313 | bool going_away; | 1317 | bool going_away; |
| 1314 | 1318 | ||
| 1315 | bool sync; | ||
| 1316 | |||
| 1317 | struct device dev; | 1319 | struct device dev; |
| 1318 | 1320 | ||
| 1319 | struct list_head h_list; | 1321 | struct list_head h_list; |
| 1320 | struct list_head node; | 1322 | struct list_head node; |
| 1323 | |||
| 1324 | unsigned int num_vals; | ||
| 1325 | unsigned int max_vals; | ||
| 1326 | struct input_value *vals; | ||
| 1321 | }; | 1327 | }; |
| 1322 | #define to_input_dev(d) container_of(d, struct input_dev, dev) | 1328 | #define to_input_dev(d) container_of(d, struct input_dev, dev) |
| 1323 | 1329 | ||
| @@ -1378,6 +1384,9 @@ struct input_handle; | |||
| 1378 | * @event: event handler. This method is being called by input core with | 1384 | * @event: event handler. This method is being called by input core with |
| 1379 | * interrupts disabled and dev->event_lock spinlock held and so | 1385 | * interrupts disabled and dev->event_lock spinlock held and so |
| 1380 | * it may not sleep | 1386 | * it may not sleep |
| 1387 | * @events: event sequence handler. This method is being called by | ||
| 1388 | * input core with interrupts disabled and dev->event_lock | ||
| 1389 | * spinlock held and so it may not sleep | ||
| 1381 | * @filter: similar to @event; separates normal event handlers from | 1390 | * @filter: similar to @event; separates normal event handlers from |
| 1382 | * "filters". | 1391 | * "filters". |
| 1383 | * @match: called after comparing device's id with handler's id_table | 1392 | * @match: called after comparing device's id with handler's id_table |
| @@ -1387,8 +1396,8 @@ struct input_handle; | |||
| 1387 | * @start: starts handler for given handle. This function is called by | 1396 | * @start: starts handler for given handle. This function is called by |
| 1388 | * input core right after connect() method and also when a process | 1397 | * input core right after connect() method and also when a process |
| 1389 | * that "grabbed" a device releases it | 1398 | * that "grabbed" a device releases it |
| 1390 | * @fops: file operations this driver implements | 1399 | * @legacy_minors: set to %true by drivers using legacy minor ranges |
| 1391 | * @minor: beginning of range of 32 minors for devices this driver | 1400 | * @minor: beginning of range of 32 legacy minors for devices this driver |
| 1392 | * can provide | 1401 | * can provide |
| 1393 | * @name: name of the handler, to be shown in /proc/bus/input/handlers | 1402 | * @name: name of the handler, to be shown in /proc/bus/input/handlers |
| 1394 | * @id_table: pointer to a table of input_device_ids this driver can | 1403 | * @id_table: pointer to a table of input_device_ids this driver can |
| @@ -1414,13 +1423,15 @@ struct input_handler { | |||
| 1414 | void *private; | 1423 | void *private; |
| 1415 | 1424 | ||
| 1416 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1425 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
| 1426 | void (*events)(struct input_handle *handle, | ||
| 1427 | const struct input_value *vals, unsigned int count); | ||
| 1417 | bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1428 | bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
| 1418 | bool (*match)(struct input_handler *handler, struct input_dev *dev); | 1429 | bool (*match)(struct input_handler *handler, struct input_dev *dev); |
| 1419 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); | 1430 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); |
| 1420 | void (*disconnect)(struct input_handle *handle); | 1431 | void (*disconnect)(struct input_handle *handle); |
| 1421 | void (*start)(struct input_handle *handle); | 1432 | void (*start)(struct input_handle *handle); |
| 1422 | 1433 | ||
| 1423 | const struct file_operations *fops; | 1434 | bool legacy_minors; |
| 1424 | int minor; | 1435 | int minor; |
| 1425 | const char *name; | 1436 | const char *name; |
| 1426 | 1437 | ||
| @@ -1488,6 +1499,10 @@ void input_reset_device(struct input_dev *); | |||
| 1488 | int __must_check input_register_handler(struct input_handler *); | 1499 | int __must_check input_register_handler(struct input_handler *); |
| 1489 | void input_unregister_handler(struct input_handler *); | 1500 | void input_unregister_handler(struct input_handler *); |
| 1490 | 1501 | ||
| 1502 | int __must_check input_get_new_minor(int legacy_base, unsigned int legacy_num, | ||
| 1503 | bool allow_dynamic); | ||
| 1504 | void input_free_minor(unsigned int minor); | ||
| 1505 | |||
| 1491 | int input_handler_for_each_handle(struct input_handler *, void *data, | 1506 | int input_handler_for_each_handle(struct input_handler *, void *data, |
| 1492 | int (*fn)(struct input_handle *, void *)); | 1507 | int (*fn)(struct input_handle *, void *)); |
| 1493 | 1508 | ||
