diff options
Diffstat (limited to 'include/linux/input.h')
| -rw-r--r-- | include/linux/input.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index f44ee9114401..7ed2251b33f1 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -58,10 +58,10 @@ struct input_absinfo { | |||
| 58 | 58 | ||
| 59 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ | 59 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ |
| 60 | #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ | 60 | #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ |
| 61 | #define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */ | 61 | #define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ |
| 62 | #define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */ | 62 | #define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ |
| 63 | #define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ | 63 | #define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ |
| 64 | #define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ | 64 | #define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ |
| 65 | 65 | ||
| 66 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ | 66 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ |
| 67 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ | 67 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ |
| @@ -378,7 +378,7 @@ struct input_absinfo { | |||
| 378 | #define KEY_WIMAX 246 | 378 | #define KEY_WIMAX 246 |
| 379 | #define KEY_RFKILL 247 /* Key that controls all radios */ | 379 | #define KEY_RFKILL 247 /* Key that controls all radios */ |
| 380 | 380 | ||
| 381 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ | 381 | /* Code 255 is reserved for special needs of AT keyboard driver */ |
| 382 | 382 | ||
| 383 | #define BTN_MISC 0x100 | 383 | #define BTN_MISC 0x100 |
| 384 | #define BTN_0 0x100 | 384 | #define BTN_0 0x100 |
| @@ -597,6 +597,7 @@ struct input_absinfo { | |||
| 597 | #define KEY_NUMERIC_POUND 0x20b | 597 | #define KEY_NUMERIC_POUND 0x20b |
| 598 | 598 | ||
| 599 | #define KEY_CAMERA_FOCUS 0x210 | 599 | #define KEY_CAMERA_FOCUS 0x210 |
| 600 | #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ | ||
| 600 | 601 | ||
| 601 | #define BTN_TRIGGER_HAPPY 0x2c0 | 602 | #define BTN_TRIGGER_HAPPY 0x2c0 |
| 602 | #define BTN_TRIGGER_HAPPY1 0x2c0 | 603 | #define BTN_TRIGGER_HAPPY1 0x2c0 |
| @@ -1141,8 +1142,10 @@ struct input_dev { | |||
| 1141 | unsigned int keycodemax; | 1142 | unsigned int keycodemax; |
| 1142 | unsigned int keycodesize; | 1143 | unsigned int keycodesize; |
| 1143 | void *keycode; | 1144 | void *keycode; |
| 1144 | int (*setkeycode)(struct input_dev *dev, int scancode, int keycode); | 1145 | int (*setkeycode)(struct input_dev *dev, |
| 1145 | int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode); | 1146 | unsigned int scancode, unsigned int keycode); |
| 1147 | int (*getkeycode)(struct input_dev *dev, | ||
| 1148 | unsigned int scancode, unsigned int *keycode); | ||
| 1146 | 1149 | ||
| 1147 | struct ff_device *ff; | 1150 | struct ff_device *ff; |
| 1148 | 1151 | ||
| @@ -1242,6 +1245,10 @@ struct input_handle; | |||
| 1242 | * @event: event handler. This method is being called by input core with | 1245 | * @event: event handler. This method is being called by input core with |
| 1243 | * interrupts disabled and dev->event_lock spinlock held and so | 1246 | * interrupts disabled and dev->event_lock spinlock held and so |
| 1244 | * it may not sleep | 1247 | * it may not sleep |
| 1248 | * @filter: similar to @event; separates normal event handlers from | ||
| 1249 | * "filters". | ||
| 1250 | * @match: called after comparing device's id with handler's id_table | ||
| 1251 | * to perform fine-grained matching between device and handler | ||
| 1245 | * @connect: called when attaching a handler to an input device | 1252 | * @connect: called when attaching a handler to an input device |
| 1246 | * @disconnect: disconnects a handler from input device | 1253 | * @disconnect: disconnects a handler from input device |
| 1247 | * @start: starts handler for given handle. This function is called by | 1254 | * @start: starts handler for given handle. This function is called by |
| @@ -1253,8 +1260,6 @@ struct input_handle; | |||
| 1253 | * @name: name of the handler, to be shown in /proc/bus/input/handlers | 1260 | * @name: name of the handler, to be shown in /proc/bus/input/handlers |
| 1254 | * @id_table: pointer to a table of input_device_ids this driver can | 1261 | * @id_table: pointer to a table of input_device_ids this driver can |
| 1255 | * handle | 1262 | * handle |
| 1256 | * @blacklist: pointer to a table of input_device_ids this driver should | ||
| 1257 | * ignore even if they match @id_table | ||
| 1258 | * @h_list: list of input handles associated with the handler | 1263 | * @h_list: list of input handles associated with the handler |
| 1259 | * @node: for placing the driver onto input_handler_list | 1264 | * @node: for placing the driver onto input_handler_list |
| 1260 | * | 1265 | * |
| @@ -1263,6 +1268,11 @@ struct input_handle; | |||
| 1263 | * same time. All of them will get their copy of input event generated by | 1268 | * same time. All of them will get their copy of input event generated by |
| 1264 | * the device. | 1269 | * the device. |
| 1265 | * | 1270 | * |
| 1271 | * The very same structure is used to implement input filters. Input core | ||
| 1272 | * allows filters to run first and will not pass event to regular handlers | ||
| 1273 | * if any of the filters indicate that the event should be filtered (by | ||
| 1274 | * returning %true from their filter() method). | ||
| 1275 | * | ||
| 1266 | * Note that input core serializes calls to connect() and disconnect() | 1276 | * Note that input core serializes calls to connect() and disconnect() |
| 1267 | * methods. | 1277 | * methods. |
| 1268 | */ | 1278 | */ |
| @@ -1271,6 +1281,8 @@ struct input_handler { | |||
| 1271 | void *private; | 1281 | void *private; |
| 1272 | 1282 | ||
| 1273 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1283 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
| 1284 | bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | ||
| 1285 | bool (*match)(struct input_handler *handler, struct input_dev *dev); | ||
| 1274 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); | 1286 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); |
| 1275 | void (*disconnect)(struct input_handle *handle); | 1287 | void (*disconnect)(struct input_handle *handle); |
| 1276 | void (*start)(struct input_handle *handle); | 1288 | void (*start)(struct input_handle *handle); |
| @@ -1280,7 +1292,6 @@ struct input_handler { | |||
| 1280 | const char *name; | 1292 | const char *name; |
| 1281 | 1293 | ||
| 1282 | const struct input_device_id *id_table; | 1294 | const struct input_device_id *id_table; |
| 1283 | const struct input_device_id *blacklist; | ||
| 1284 | 1295 | ||
| 1285 | struct list_head h_list; | 1296 | struct list_head h_list; |
| 1286 | struct list_head node; | 1297 | struct list_head node; |
| @@ -1406,8 +1417,10 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
| 1406 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); | 1417 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); |
| 1407 | } | 1418 | } |
| 1408 | 1419 | ||
| 1409 | int input_get_keycode(struct input_dev *dev, int scancode, int *keycode); | 1420 | int input_get_keycode(struct input_dev *dev, |
| 1410 | int input_set_keycode(struct input_dev *dev, int scancode, int keycode); | 1421 | unsigned int scancode, unsigned int *keycode); |
| 1422 | int input_set_keycode(struct input_dev *dev, | ||
| 1423 | unsigned int scancode, unsigned int keycode); | ||
| 1411 | 1424 | ||
| 1412 | extern struct class input_class; | 1425 | extern struct class input_class; |
| 1413 | 1426 | ||
