[PATCH] input: usb_kbd: make polling interval configurable

Sascha Hauer s.hauer at pengutronix.de
Tue Oct 15 00:47:22 PDT 2024


On Mon, Oct 14, 2024 at 05:32:38PM +0200, Ahmad Fatoum via B4 Relay wrote:
> From: Ahmad Fatoum <a.fatoum at barebox.org>
> 
> 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 at barebox.org>
> ---
>  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);

Should be polling_interval_ms to make it more clear what is expected
here.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list