forked from rubenslte/android_kernel_samsung_msm8226
Merge remote-tracking branch 'google-common/deprecated/android-3.4' into lineage-16.0
Change-Id: I363f9d4d0623906eaffffb3747a162ccbc92ccb0 Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
committed by
Francescodario Cuzzocrea
parent
d9d42139ea
commit
0fdd45c3ac
+22
-2
@@ -37,6 +37,8 @@ struct evdev {
|
||||
struct mutex mutex;
|
||||
struct device dev;
|
||||
bool exist;
|
||||
int hw_ts_sec;
|
||||
int hw_ts_nsec;
|
||||
};
|
||||
|
||||
struct evdev_client {
|
||||
@@ -109,7 +111,20 @@ static void evdev_event(struct input_handle *handle,
|
||||
struct input_event event;
|
||||
ktime_t time_mono, time_real;
|
||||
|
||||
time_mono = ktime_get();
|
||||
if (type == EV_SYN && code == SYN_TIME_SEC) {
|
||||
evdev->hw_ts_sec = value;
|
||||
return;
|
||||
}
|
||||
if (type == EV_SYN && code == SYN_TIME_NSEC) {
|
||||
evdev->hw_ts_nsec = value;
|
||||
return;
|
||||
}
|
||||
|
||||
if (evdev->hw_ts_sec != -1 && evdev->hw_ts_nsec != -1)
|
||||
time_mono = ktime_set(evdev->hw_ts_sec, evdev->hw_ts_nsec);
|
||||
else
|
||||
time_mono = ktime_get();
|
||||
|
||||
time_real = ktime_sub(time_mono, ktime_get_monotonic_offset());
|
||||
|
||||
event.type = type;
|
||||
@@ -128,8 +143,11 @@ static void evdev_event(struct input_handle *handle,
|
||||
|
||||
rcu_read_unlock();
|
||||
|
||||
if (type == EV_SYN && code == SYN_REPORT)
|
||||
if (type == EV_SYN && code == SYN_REPORT) {
|
||||
evdev->hw_ts_sec = -1;
|
||||
evdev->hw_ts_nsec = -1;
|
||||
wake_up_interruptible(&evdev->wait);
|
||||
}
|
||||
}
|
||||
|
||||
static int evdev_fasync(int fd, struct file *file, int on)
|
||||
@@ -1062,6 +1080,8 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,
|
||||
dev_set_name(&evdev->dev, "event%d", minor);
|
||||
evdev->exist = true;
|
||||
evdev->minor = minor;
|
||||
evdev->hw_ts_sec = -1;
|
||||
evdev->hw_ts_nsec = -1;
|
||||
|
||||
evdev->handle.dev = input_get_device(dev);
|
||||
evdev->handle.name = dev_name(&evdev->dev);
|
||||
|
||||
Reference in New Issue
Block a user