[PATCH] input: usb_kbd: make polling interval configurable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ahmad Fatoum <a.fatoum@xxxxxxxxxxx>

We currently use whatever polling interval the keyboard reports, but in
some keyboard it can be useful to set a lower interval, e.g. for better
control of the snake in the barebox demo[1].

Add a parameter to make this possible.

[1]: https://fosstodon.org/@barebox/112983807569839989

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxx>
---
 drivers/input/usb_kbd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/input/usb_kbd.c b/drivers/input/usb_kbd.c
index 2e75aabf3da4..d47e760a89ee 100644
--- a/drivers/input/usb_kbd.c
+++ b/drivers/input/usb_kbd.c
@@ -169,6 +169,11 @@ static int usb_kbd_probe(struct usb_device *usbdev,
 	data->intpktsize = min(usb_maxpacket(usbdev, data->intpipe),
 			       USB_KBD_BOOT_REPORT_SIZE);
 	data->intinterval = data->ep->bInterval;
+
+	dev_add_param_uint32(&usbdev->dev, "polling_interval",
+			     NULL, NULL, &data->intinterval, "%u",
+			     NULL);
+
 	/* test polling via interrupt endpoint */
 	data->do_poll = usb_kbd_int_poll;
 	ret = data->do_poll(data);

---
base-commit: ac1be0df8dce0a220e254005e1e07a0d23299f6b
change-id: 20241014-usb_kbd-polling_interval-0e84d06d8d35

Best regards,
-- 
Ahmad Fatoum <a.fatoum@xxxxxxxxxxx>






[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux