Commit 2ddc8e2d authored by Filip Alac's avatar Filip Alac Committed by Jiri Kosina

HID: usbhid: extend the polling interval configuration to keyboards

For mouse and joystick devices user can change the polling interval
via usbhid.mousepoll and usbhid.jspoll.
Implement the same thing for keyboards, so user can
reduce(or increase) input latency this way.

This has been tested with a Cooler Master Devastator with
kbpoll=32, resulting in delay between events of 32 ms(values were taken
from evtest).
Signed-off-by: default avatarFilip Alac <filipalac@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent c17a7476
...@@ -4352,6 +4352,9 @@ ...@@ -4352,6 +4352,9 @@
usbhid.jspoll= usbhid.jspoll=
[USBHID] The interval which joysticks are to be polled at. [USBHID] The interval which joysticks are to be polled at.
usbhid.kbpoll=
[USBHID] The interval which keyboards are to be polled at.
usb-storage.delay_use= usb-storage.delay_use=
[UMS] The delay in seconds before a new device is [UMS] The delay in seconds before a new device is
scanned for Logical Units (default 1). scanned for Logical Units (default 1).
......
...@@ -56,6 +56,10 @@ static unsigned int hid_jspoll_interval; ...@@ -56,6 +56,10 @@ static unsigned int hid_jspoll_interval;
module_param_named(jspoll, hid_jspoll_interval, uint, 0644); module_param_named(jspoll, hid_jspoll_interval, uint, 0644);
MODULE_PARM_DESC(jspoll, "Polling interval of joysticks"); MODULE_PARM_DESC(jspoll, "Polling interval of joysticks");
static unsigned int hid_kbpoll_interval;
module_param_named(kbpoll, hid_kbpoll_interval, uint, 0644);
MODULE_PARM_DESC(kbpoll, "Polling interval of keyboards");
static unsigned int ignoreled; static unsigned int ignoreled;
module_param_named(ignoreled, ignoreled, uint, 0644); module_param_named(ignoreled, ignoreled, uint, 0644);
MODULE_PARM_DESC(ignoreled, "Autosuspend with active leds"); MODULE_PARM_DESC(ignoreled, "Autosuspend with active leds");
...@@ -1094,7 +1098,9 @@ static int usbhid_start(struct hid_device *hid) ...@@ -1094,7 +1098,9 @@ static int usbhid_start(struct hid_device *hid)
hid->name, endpoint->bInterval, interval); hid->name, endpoint->bInterval, interval);
} }
/* Change the polling interval of mice and joysticks. */ /* Change the polling interval of mice, joysticks
* and keyboards.
*/
switch (hid->collection->usage) { switch (hid->collection->usage) {
case HID_GD_MOUSE: case HID_GD_MOUSE:
if (hid_mousepoll_interval > 0) if (hid_mousepoll_interval > 0)
...@@ -1104,6 +1110,10 @@ static int usbhid_start(struct hid_device *hid) ...@@ -1104,6 +1110,10 @@ static int usbhid_start(struct hid_device *hid)
if (hid_jspoll_interval > 0) if (hid_jspoll_interval > 0)
interval = hid_jspoll_interval; interval = hid_jspoll_interval;
break; break;
case HID_GD_KEYBOARD:
if (hid_kbpoll_interval > 0)
interval = hid_kbpoll_interval;
break;
} }
ret = -ENOMEM; ret = -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment