Revert "Input: add infrastructure for selecting clockid for event time stamps"
Varun Wadekar [Fri, 20 Apr 2012 06:53:01 +0000 (11:53 +0530)]
This reverts commit a80b83b7b8456e9b475346c2e01d7e210883208c.

Conflicts:

include/linux/input.h

Change-Id: I66eaf70a5ca9d3c3b96c4e58a460abbab02916e9
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/97839
Tested-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>

drivers/input/evdev.c
include/linux/input.h
kernel/time/timekeeping.c

index d7f2e30..29f6108 100644 (file)
@@ -50,7 +50,6 @@ struct evdev_client {
        struct fasync_struct *fasync;
        struct evdev *evdev;
        struct list_head node;
-       int clkid;
        unsigned int bufsize;
        struct input_event buffer[];
 };
@@ -59,12 +58,8 @@ static struct evdev *evdev_table[EVDEV_MINORS];
 static DEFINE_MUTEX(evdev_table_mutex);
 
 static void evdev_pass_event(struct evdev_client *client,
-                            struct input_event *event,
-                            ktime_t mono, ktime_t real)
+                            struct input_event *event)
 {
-       event->time = ktime_to_timeval(client->clkid == CLOCK_MONOTONIC ?
-                                       mono : real);
-
        /* Interrupts are disabled, just acquire the lock. */
        spin_lock(&client->buffer_lock);
 
@@ -107,11 +102,8 @@ static void evdev_event(struct input_handle *handle,
        struct evdev *evdev = handle->private;
        struct evdev_client *client;
        struct input_event event;
-       ktime_t time_mono, time_real;
-
-       time_mono = ktime_get();
-       time_real = ktime_sub(time_mono, ktime_get_monotonic_offset());
 
+       do_gettimeofday(&event.time);
        event.type = type;
        event.code = code;
        event.value = value;
@@ -119,12 +111,11 @@ static void evdev_event(struct input_handle *handle,
        rcu_read_lock();
 
        client = rcu_dereference(evdev->grab);
-
        if (client)
-               evdev_pass_event(client, &event, time_mono, time_real);
+               evdev_pass_event(client, &event);
        else
                list_for_each_entry_rcu(client, &evdev->client_list, node)
-                       evdev_pass_event(client, &event, time_mono, time_real);
+                       evdev_pass_event(client, &event);
 
        rcu_read_unlock();
 
@@ -759,14 +750,6 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
                else
                        return evdev_ungrab(evdev, client);
 
-       case EVIOCSCLOCKID:
-               if (copy_from_user(&i, p, sizeof(unsigned int)))
-                       return -EFAULT;
-               if (i != CLOCK_MONOTONIC && i != CLOCK_REALTIME)
-                       return -EINVAL;
-               client->clkid = i;
-               return 0;
-
        case EVIOCGKEYCODE:
                return evdev_handle_get_keycode(dev, p);
 
index 49fb20e..808043c 100644 (file)
@@ -157,8 +157,6 @@ struct input_keymap_entry {
 #define EVIOCGSUSPENDBLOCK     _IOR('E', 0x91, int)                    /* get suspend block enable */
 #define EVIOCSSUSPENDBLOCK     _IOW('E', 0x91, int)                    /* set suspend block enable */
 
-#define EVIOCSCLOCKID          _IOW('E', 0xa0, int)                    /* Set clockid to be used for timestamps */
-
 /*
  * Device properties and quirks
  */
index d66b213..51b9856 100644 (file)
@@ -1261,8 +1261,6 @@ ktime_t ktime_get_monotonic_offset(void)
 
        return timespec_to_ktime(wtom);
 }
-EXPORT_SYMBOL_GPL(ktime_get_monotonic_offset);
-
 
 /**
  * xtime_update() - advances the timekeeping infrastructure