History

Input: add support for polling to input devices

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.

Dmitry Torokhov committed 9 years ago

Commit e95656e1 parent 2da9d2b5 files · +273 −8Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/input.h+12−0
@@ -21,6 +21,8 @@ · 20 unmodified lines
21#include <linux/timer.h>21#include <linux/timer.h>
22#include <linux/mod_devicetable.h>22#include <linux/mod_devicetable.h>
23 23
24struct input_dev_poller;
25
24/**26/**
25 * struct input_value - input value representation27 * struct input_value - input value representation
26 * @type: type of value (EV_KEY, EV_ABS, etc)28 * @type: type of value (EV_KEY, EV_ABS, etc)
@@ -71,6 +73,8 @@ enum input_clock_type { · 44 unmodified lines
71 * not sleep73 * not sleep
72 * @ff: force feedback structure associated with the device if device74 * @ff: force feedback structure associated with the device if device
73 * supports force feedback effects75 * supports force feedback effects
76 * @poller: poller structure associated with the device if device is
77 * set up to use polling mode
74 * @repeat_key: stores key code of the last key pressed; used to implement78 * @repeat_key: stores key code of the last key pressed; used to implement
75 * software autorepeat79 * software autorepeat
76 * @timer: timer for software autorepeat80 * @timer: timer for software autorepeat
@@ -156,6 +160,8 @@ struct input_dev { · 79 unmodified lines
156 160
157 struct ff_device *ff;161 struct ff_device *ff;
158 162
163 struct input_dev_poller *poller;
164
159 unsigned int repeat_key;165 unsigned int repeat_key;
160 struct timer_list timer;166 struct timer_list timer;
161 167
@@ -372,6 +378,12 @@ void input_unregister_device(struct input_dev *); · 210 unmodified lines
372 378
373void input_reset_device(struct input_dev *);379void input_reset_device(struct input_dev *);
374 380
381int input_setup_polling(struct input_dev *dev,
382 void (*poll_fn)(struct input_dev *dev));
383void input_set_poll_interval(struct input_dev *dev, unsigned int interval);
384void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval);
385void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval);
386
375int __must_check input_register_handler(struct input_handler *);387int __must_check input_register_handler(struct input_handler *);
376void input_unregister_handler(struct input_handler *);388void input_unregister_handler(struct input_handler *);
377 389

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t