brcm2708: update linux 4.4 patches to latest version
[openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0070-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch
1 From b15f112ddaf2cd20a8f999ac823ddb51d7d513b9 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Mon, 14 Jul 2014 22:02:09 +0100
4 Subject: [PATCH 070/170] hid: Reduce default mouse polling interval to 60Hz
5
6 Reduces overhead when using X
7 ---
8  drivers/hid/usbhid/hid-core.c | 10 +++++++---
9  1 file changed, 7 insertions(+), 3 deletions(-)
10
11 --- a/drivers/hid/usbhid/hid-core.c
12 +++ b/drivers/hid/usbhid/hid-core.c
13 @@ -49,7 +49,7 @@
14   * Module parameters.
15   */
16  
17 -static unsigned int hid_mousepoll_interval;
18 +static unsigned int hid_mousepoll_interval = ~0;
19  module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
20  MODULE_PARM_DESC(mousepoll, "Polling interval of mice");
21  
22 @@ -1091,8 +1091,12 @@ static int usbhid_start(struct hid_devic
23                 }
24  
25                 /* Change the polling interval of mice. */
26 -               if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0)
27 -                       interval = hid_mousepoll_interval;
28 +               if (hid->collection->usage == HID_GD_MOUSE) {
29 +                               if (hid_mousepoll_interval == ~0 && interval < 16)
30 +                                               interval = 16;
31 +                               else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0)
32 +                                               interval = hid_mousepoll_interval;
33 +               }
34  
35                 ret = -ENOMEM;
36                 if (usb_endpoint_dir_in(endpoint)) {