]> git.baikalelectronics.ru Git - kernel.git/commit
Input: add infrastructure for selecting clockid for event time stamps
authorJohn Stultz <john.stultz@linaro.org>
Fri, 3 Feb 2012 08:19:07 +0000 (00:19 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 3 Feb 2012 08:24:58 +0000 (00:24 -0800)
commitd17335d23511fb5656786a8df9fd1e935158cf26
treefb05acce28923e0e62b1b13cd39b9e1eee9bd0ae
parentc472d2cfbc60fcda26a8648118e1a743cb50c4a6
Input: add infrastructure for selecting clockid for event time stamps

As noted by Arve and others, since wall time can jump backwards, it is
difficult to use for input because one cannot determine if one event
occurred before another or for how long a key was pressed.

However, the timestamp field is part of the kernel ABI, and cannot be
changed without possibly breaking existing users.

This patch adds a new IOCTL that allows a clockid to be set in the
evdev_client struct that will specify which time base to use for event
timestamps (ie: CLOCK_MONOTONIC instead of CLOCK_REALTIME).

For now we only support CLOCK_MONOTONIC and CLOCK_REALTIME, but
in the future we could support other clockids if appropriate.

The default remains CLOCK_REALTIME, so we don't change the ABI.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Daniel Kurtz <djkurtz@google.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/evdev.c
include/linux/input.h
kernel/time/timekeeping.c