mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Documentation: input: Add section pertaining to polled input devices
@ 2025-02-08 17:35 Brendan Connelly
  2025-02-10  2:18 ` Bagas Sanjaya
  2025-02-21 20:30 ` Jonathan Corbet
  0 siblings, 2 replies; 3+ messages in thread
From: Brendan Connelly @ 2025-02-08 17:35 UTC (permalink / raw)
  To: corbet; +Cc: linux-kernel, linux-doc, dmitry.torokhov

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>
---
 Documentation/input/input-programming.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/input/input-programming.rst b/Documentation/input/input-programming.rst
index c9264814c7aa..2b3e6a34e34b 100644
--- a/Documentation/input/input-programming.rst
+++ b/Documentation/input/input-programming.rst
@@ -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.
-- 
2.39.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Documentation: input: Add section pertaining to polled input devices
  2025-02-08 17:35 [PATCH] Documentation: input: Add section pertaining to polled input devices Brendan Connelly
@ 2025-02-10  2:18 ` Bagas Sanjaya
  2025-02-21 20:30 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Bagas Sanjaya @ 2025-02-10  2:18 UTC (permalink / raw)
  To: Brendan Connelly, corbet; +Cc: linux-kernel, linux-doc, dmitry.torokhov

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

On Sat, Feb 08, 2025 at 12:35:54PM -0500, Brendan Connelly wrote:
> +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.

Looks good, thanks!

Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Documentation: input: Add section pertaining to polled input devices
  2025-02-08 17:35 [PATCH] Documentation: input: Add section pertaining to polled input devices Brendan Connelly
  2025-02-10  2:18 ` Bagas Sanjaya
@ 2025-02-21 20:30 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2025-02-21 20:30 UTC (permalink / raw)
  To: Brendan Connelly; +Cc: linux-kernel, linux-doc, dmitry.torokhov

Brendan Connelly <brendanjconnelly17@gmail.com> writes:

> 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>
> ---
>  Documentation/input/input-programming.rst | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Applied, thanks.

jon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-21 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-08 17:35 [PATCH] Documentation: input: Add section pertaining to polled input devices Brendan Connelly
2025-02-10  2:18 ` Bagas Sanjaya
2025-02-21 20:30 ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®