Separating "normal" and "polled" input devices was a mistake, as often we want to allow the very same device work on both interrupt-driven and polled mode, depending on the board on which the device is used. This introduces new APIs: - input_setup_polling - input_set_poll_interval - input_set_min_poll_interval - input_set_max_poll_interval These new APIs allow switching an input device into polled mode with sysfs attributes matching drivers using input_polled_dev APIs that will be eventually removed.
Showing the changes to include/linux (1 of 5 files). Show all
Unified · Split
| @@ -21,6 +21,8 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <linux/timer.h> |
| 22 | 22 | #include <linux/mod_devicetable.h> |
| 23 | 23 | |
| 24 | +struct input_dev_poller; | |
| 25 | + | |
| 24 | 26 | /** |
| 25 | 27 | * struct input_value - input value representation |
| 26 | 28 | * @type: type of value (EV_KEY, EV_ABS, etc) |
| @@ -71,6 +73,8 @@ enum input_clock_type { · 44 unmodified lines | ||
| 71 | 73 | * not sleep |
| 72 | 74 | * @ff: force feedback structure associated with the device if device |
| 73 | 75 | * supports force feedback effects |
| 76 | + * @poller: poller structure associated with the device if device is | |
| 77 | + * set up to use polling mode | |
| 74 | 78 | * @repeat_key: stores key code of the last key pressed; used to implement |
| 75 | 79 | * software autorepeat |
| 76 | 80 | * @timer: timer for software autorepeat |
| @@ -156,6 +160,8 @@ struct input_dev { · 79 unmodified lines | ||
| 156 | 160 | |
| 157 | 161 | struct ff_device *ff; |
| 158 | 162 | |
| 163 | + struct input_dev_poller *poller; | |
| 164 | + | |
| 159 | 165 | unsigned int repeat_key; |
| 160 | 166 | struct timer_list timer; |
| 161 | 167 | |
| @@ -372,6 +378,12 @@ void input_unregister_device(struct input_dev *); · 210 unmodified lines | ||
| 372 | 378 | |
| 373 | 379 | void input_reset_device(struct input_dev *); |
| 374 | 380 | |
| 381 | +int input_setup_polling(struct input_dev *dev, | |
| 382 | + void (*poll_fn)(struct input_dev *dev)); | |
| 383 | +void input_set_poll_interval(struct input_dev *dev, unsigned int interval); | |
| 384 | +void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval); | |
| 385 | +void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval); | |
| 386 | + | |
| 375 | 387 | int __must_check input_register_handler(struct input_handler *); |
| 376 | 388 | void input_unregister_handler(struct input_handler *); |
| 377 | 389 | |