Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c5b6ff0 authored by Shaikh Shadul's avatar Shaikh Shadul
Browse files

input: add new input event code to pass timestamp to userspace



There is timestamp jitter between the input events and input_sync.
Add two more event code to pass the timestamp to userspace. This
is needed since some input devices such as sensors need to retrieve
the accurate timestamp of the events generated.

Change-Id: I8d83739dfa4a70ca3877363c920bd5e3301f5494
Signed-off-by: default avatarOliver Wang <mengmeng@codeaurora.org>
Signed-off-by: default avatarShaikh Shadul <sshadu@codeaurora.org>
parent e539a094
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -91,6 +91,11 @@ sent in the evdev event stream.
    event and query the device (using EVIOCG* ioctls) to obtain its
    current state.

* SYN_TIME_SEC, SYN_TIME_NSEC:
  - Used to report the timestamp from the hardware. The timestamp should record
    the exact time when the hardware events happens. The timestamp is
    CLOCK_MONOTONIC based.

EV_KEY:
----------
EV_KEY events take the form KEY_<name> or BTN_<name>. For example, KEY_A is used
+2 −0
Original line number Diff line number Diff line
@@ -267,6 +267,8 @@ static int input_get_disposition(struct input_dev *dev,
	case EV_SYN:
		switch (code) {
		case SYN_CONFIG:
		case SYN_TIME_SEC:
		case SYN_TIME_NSEC:
			disposition = INPUT_PASS_TO_ALL;
			break;

+2 −0
Original line number Diff line number Diff line
@@ -203,6 +203,8 @@ struct input_keymap_entry {
#define SYN_CONFIG		1
#define SYN_MT_REPORT		2
#define SYN_DROPPED		3
#define SYN_TIME_SEC		4
#define SYN_TIME_NSEC		5
#define SYN_MAX			0xf
#define SYN_CNT			(SYN_MAX+1)