mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
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. Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
2da9d2b5b9
commit
e95656ea15
5 changed files with 273 additions and 8 deletions
|
@ -21,6 +21,8 @@
|
|||
#include <linux/timer.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
struct input_dev_poller;
|
||||
|
||||
/**
|
||||
* struct input_value - input value representation
|
||||
* @type: type of value (EV_KEY, EV_ABS, etc)
|
||||
|
@ -71,6 +73,8 @@ enum input_clock_type {
|
|||
* not sleep
|
||||
* @ff: force feedback structure associated with the device if device
|
||||
* supports force feedback effects
|
||||
* @poller: poller structure associated with the device if device is
|
||||
* set up to use polling mode
|
||||
* @repeat_key: stores key code of the last key pressed; used to implement
|
||||
* software autorepeat
|
||||
* @timer: timer for software autorepeat
|
||||
|
@ -156,6 +160,8 @@ struct input_dev {
|
|||
|
||||
struct ff_device *ff;
|
||||
|
||||
struct input_dev_poller *poller;
|
||||
|
||||
unsigned int repeat_key;
|
||||
struct timer_list timer;
|
||||
|
||||
|
@ -372,6 +378,12 @@ void input_unregister_device(struct input_dev *);
|
|||
|
||||
void input_reset_device(struct input_dev *);
|
||||
|
||||
int input_setup_polling(struct input_dev *dev,
|
||||
void (*poll_fn)(struct input_dev *dev));
|
||||
void input_set_poll_interval(struct input_dev *dev, unsigned int interval);
|
||||
void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval);
|
||||
void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval);
|
||||
|
||||
int __must_check input_register_handler(struct input_handler *);
|
||||
void input_unregister_handler(struct input_handler *);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue