]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Documentation: input: Add section pertaining to polled input devices
authorBrendan Connelly <brendanjconnelly17@gmail.com>
Sat, 8 Feb 2025 17:35:54 +0000 (12:35 -0500)
committerJonathan Corbet <corbet@lwn.net>
Fri, 21 Feb 2025 20:29:53 +0000 (13:29 -0700)
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
Documentation/input/input-programming.rst

index c9264814c7aa6823e27858d2e1e7cb5448069012..2b3e6a34e34bd83fd058452dbc0b13f5ee3d203c 100644 (file)
@@ -346,3 +346,22 @@ driver can handle these events, it has to set the respective bits in evbit,
 
 This callback routine can be called from an interrupt or a BH (although that
 isn't a rule), and thus must not sleep, and must not take too long to finish.
+
+Polled input devices
+~~~~~~~~~~~~~~~~~~~~
+
+Input polling is set up by passing an input device struct and a callback to
+the function::
+
+    int input_setup_polling(struct input_dev *dev,
+        void (*poll_fn)(struct input_dev *dev))
+
+Within the callback, devices should use the regular input_report_* functions
+and input_sync as is used by other devices.
+
+There is also the function::
+
+    void input_set_poll_interval(struct input_dev *dev, unsigned int interval)
+
+which is used to configure the interval, in milliseconds, that the device will
+be polled at.