--- clean/drivers/usb/input/hid-core.c +++ dirty/drivers/usb/input/hid-core.c @@ -37,11 +37,12 @@ * Version Information */ -#define DRIVER_VERSION "v2.0" +#define DRIVER_VERSION "v2.01" #define DRIVER_AUTHOR "Andreas Gal, Vojtech Pavlik" #define DRIVER_DESC "USB HID core driver" #define DRIVER_LICENSE "GPL" +static unsigned int hid_mousepoll_interval = 10; static char *hid_types[] = {"Device", "Pointer", "Mouse", "Device", "Joystick", "Gamepad", "Keyboard", "Keypad", "Multi-Axis Controller"}; @@ -1663,6 +1664,11 @@ if ((endpoint->bmAttributes & 3) != 3) /* Not an interrupt endpoint */ continue; + /* Change the polling interval of mice. */ + if (hid->collection->usage == HID_GD_MOUSE + && hid_mousepoll_interval > 0) + endpoint->bInterval = hid_mousepoll_interval; + /* handle potential highspeed HID correctly */ interval = endpoint->bInterval; if (dev->speed == USB_SPEED_HIGH) @@ -1910,6 +1916,7 @@ module_init(hid_init); module_exit(hid_exit); +module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); --- clean/drivers/usb/input/Kconfig +++ dirty/drivers/usb/input/Kconfig @@ -24,6 +24,38 @@ To compile this driver as a module, choose M here: the module will be called usbhid. +config USB_HID_MOUSE_POLLING_INTERVAL + int "USB HID Mouse Interrupt Polling Interval" + default 10 + depends on USB_HID + help + The "USB HID Mouse Interrupt Polling Interval" is the interval, at + which your USB HID mouse is to be polled at. The interval is + specified in milliseconds. + + Decreasing the interval will, of course, give you a much more + precise mouse. + + Generally speaking, a polling interval of 2 ms should be more than + enough for most people, and is great for gaming and other things + that require high precision. + + An interval lower than the default is not guaranteed work on your + specific piece of hardware. If you want to play it safe, don't + change this value. + + Now, if you indeed want to feel the joy of a precise mouse, the + following mice are known to work without problems, when the interval + is set to at least 2 ms: + + * Logitech's MX-family + * Logitech Mouse Man Dual Optical + * Logitech iFeel + * Microsoft Intellimouse Explorer + * Microsoft Intellimouse Optical 1.1 + + If unsure, keep it at 10 ms. + comment "Input core support is needed for USB HID input layer or HIDBP support" depends on USB_HID && INPUT=n --- clean/drivers/usb/input/hid-core.c +++ dirty/drivers/usb/input/hid-core.c @@ -42,7 +42,7 @@ #define DRIVER_DESC "USB HID core driver" #define DRIVER_LICENSE "GPL" -static unsigned int hid_mousepoll_interval = 10; +static unsigned int hid_mousepoll_interval = CONFIG_USB_HID_MOUSE_POLLING_INTERVAL; static char *hid_types[] = {"Device", "Pointer", "Mouse", "Device", "Joystick", "Gamepad", "Keyboard", "Keypad", "Multi-Axis Controller"};