Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <brendanjconnelly17@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250208173554.209688-1-brendanjconnelly17@gmail.com

authored by

Brendan Connelly and committed by
Jonathan Corbet
76a67822 4dd4eef6

+19
+19
Documentation/input/input-programming.rst
··· 346 346 347 347 This callback routine can be called from an interrupt or a BH (although that 348 348 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.