Skip to content

Commit 76a6782

Browse files
brendanjconnellyJonathan Corbet
authored andcommitted
Documentation: input: Add section pertaining to polled input devices
Added section in Documentation/input/input-programming.rst about input_setup_polling() and input_set_poll_interval() Signed-off-by: Brendan Connelly <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4dd4eef commit 76a6782

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Documentation/input/input-programming.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,22 @@ driver can handle these events, it has to set the respective bits in evbit,
346346

347347
This callback routine can be called from an interrupt or a BH (although that
348348
isn't a rule), and thus must not sleep, and must not take too long to finish.
349+
350+
Polled input devices
351+
~~~~~~~~~~~~~~~~~~~~
352+
353+
Input polling is set up by passing an input device struct and a callback to
354+
the function::
355+
356+
int input_setup_polling(struct input_dev *dev,
357+
void (*poll_fn)(struct input_dev *dev))
358+
359+
Within the callback, devices should use the regular input_report_* functions
360+
and input_sync as is used by other devices.
361+
362+
There is also the function::
363+
364+
void input_set_poll_interval(struct input_dev *dev, unsigned int interval)
365+
366+
which is used to configure the interval, in milliseconds, that the device will
367+
be polled at.

0 commit comments

Comments
 (0)