summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2008-10-17 15:28:08 -0700
committerColin Cross <ccross@android.com>2012-02-14 11:25:55 -0800
commit18504990f0df5ed655ab6d8918be9aa93de2e8a5 (patch)
treec3dd74bfbbb1e7f0d65dbf0a080b331b39b2fb59 /drivers
parent2f8f1b5814f65e82de93d2115c6fcaa7f90b2883 (diff)
Input: Use monotonic time for event time stamps.
Since wall time can jump backwards, it cannot be used to determine if one event occured before another or for how long a key was pressed. Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/evdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 181dde3b578..04d02cad56e 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -102,8 +102,11 @@ static void evdev_event(struct input_handle *handle,
struct evdev *evdev = handle->private;
struct evdev_client *client;
struct input_event event;
+ struct timespec ts;
- do_gettimeofday(&event.time);
+ ktime_get_ts(&ts);
+ event.time.tv_sec = ts.tv_sec;
+ event.time.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
event.type = type;
event.code = code;
event.value = value;