platform/upstream/libevdev.git
11 years agoFree the event queue on cleanup.
Peter Hutterer [Fri, 31 May 2013 05:24:39 +0000 (15:24 +1000)]
Free the event queue on cleanup.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoCheck for allocation failure in libevdev_new()
Peter Hutterer [Fri, 31 May 2013 01:26:01 +0000 (11:26 +1000)]
Check for allocation failure in libevdev_new()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoRename ER_SYNC flag to LIBEVDEV_READ_SYNC
Peter Hutterer [Thu, 30 May 2013 04:04:33 +0000 (14:04 +1000)]
Rename ER_SYNC flag to LIBEVDEV_READ_SYNC

ER dated to an earlier version of this library called libevdev_read.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAdd a function to retrieve the current slot
Peter Hutterer [Thu, 30 May 2013 04:02:17 +0000 (14:02 +1000)]
Add a function to retrieve the current slot

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoUpdate the MT state properly
Peter Hutterer [Thu, 30 May 2013 03:58:45 +0000 (13:58 +1000)]
Update the MT state properly

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoIf a client doesn't sync when it should, drop all sync events
Peter Hutterer [Thu, 30 May 2013 02:24:46 +0000 (12:24 +1000)]
If a client doesn't sync when it should, drop all sync events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAfter a SYN_DROPPED, drop all events in the queue
Peter Hutterer [Thu, 30 May 2013 02:20:21 +0000 (12:20 +1000)]
After a SYN_DROPPED, drop all events in the queue

Ideally, we could sync by pre-pending all the sync events and then pretend
nothing happened but our queue is too small and likely too full for any
extra events. So drop all events, then add the sync events to the queue.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAbstract the event queue away
Peter Hutterer [Thu, 30 May 2013 01:05:24 +0000 (11:05 +1000)]
Abstract the event queue away

Provide a couple of handler functions to avoid erroneous queue updates. This
will make it easier if we need to swap queue implementation later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoDrop the callback interface, replace with libevdev_next_event
Peter Hutterer [Thu, 30 May 2013 00:42:24 +0000 (10:42 +1000)]
Drop the callback interface, replace with libevdev_next_event

Callbacks looked good on paper, but synaptics ran into an issue already that
it just couldn't easily pass around the state needed in the actual event
processing function.

Replace with a new interface that only returns the next event (still reading
more off the fd while doing so).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAdd log func handling
Peter Hutterer [Wed, 29 May 2013 23:00:13 +0000 (09:00 +1000)]
Add log func handling

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoFix MT slot index handling
Peter Hutterer [Thu, 30 May 2013 02:18:39 +0000 (12:18 +1000)]
Fix MT slot index handling

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agolibevdev is a library to handle evdev devices
Peter Hutterer [Mon, 27 May 2013 04:59:41 +0000 (14:59 +1000)]
libevdev is a library to handle evdev devices

Two main goals of this library:
- 'transparently' handle SYN_DROPPED events
- avoid errors in ioctl handling by providing a simpler interface.

Keeps a cached copy of the device for quick querying.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>