[PATCH] hid-core: Configurable USB HID Mouse Interrupt PollingInterval

From: Mikkel Krautz
Date: Fri Dec 17 2004 - 18:59:05 EST


Hi!

This patch adds the option "USB HID Mouse Interrupt Polling Interval"
to drivers/usb/input/Kconfig, and a few lines of code to
drivers/usb/input/hid-core.c, to make the config option function.

It allows people to change the interval, at which their USB HID mice
are polled at. This is extremely useful for people who require high
precision, or just likes the feeling of a very precise mouse. ;)

As the Kconfig help implies, setting a lower polling interval is known
to work on several mice produced by Logitech and Microsoft. I only
have a Logitech MX500 to test it on. My results have been positive,
and so have many other people's.

Mikkel Krautz




Signed-off-by: Mikkel Krautz <krautz@xxxxxxxxx>
---

--- 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 miliseconds.
+
+ 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
@@ -37,7 +37,7 @@
* 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"
@@ -1663,6 +1663,12 @@
if ((endpoint->bmAttributes & 3) != 3) /* Not an interrupt endpoint
*/
continue;

+ /* Set the interrupt polling interval of mice, to the one specified
in the config. */
+ if (hid->collection->usage == HID_GD_MOUSE
+ && CONFIG_USB_HID_MOUSE_POLLING_INTERVAL > 0
+ && CONFIG_USB_HID_MOUSE_POLLING_INTERVAL < 255)
+ endpoint->bInterval = CONFIG_USB_HID_MOUSE_POLLING_INTERVAL;
+
/* handle potential highspeed HID correctly */
interval = endpoint->bInterval;
if (dev->speed == USB_SPEED_HIGH)



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/