]> git.baikalelectronics.ru Git - kernel.git/commit
Input: joystick - use ktime for measuring timing
authorTakashi Iwai <tiwai@suse.de>
Thu, 11 Sep 2014 17:28:30 +0000 (10:28 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 12 Sep 2014 06:41:18 +0000 (23:41 -0700)
commit6cd48080cc033d0085605cf7925ee08deb7cf7ad
tree20acc49eb856fa49c321e3616424f166fc5053a7
parent511381846e4d36f8246a5d04d95d568d0923997d
Input: joystick - use ktime for measuring timing

The current codes in gameport and analog joystick drivers for the time
accounting have a long-standing problem when the system is running
with CPU freq; since the timing is measured via TSC or sample counter,
the calculation isn't reliable.

In this patch, as a simple fix, use the standard ktime to measure the
timing.  In case where no high resolution timer is available,
use_ktime bool option is provided to both modules.  Setting
use_ktime=false switches to the old methods.

Tested-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/gameport/gameport.c
drivers/input/joystick/analog.c