Commit Graph

10 Commits

Author SHA1 Message Date
Oleksandr Tymoshenko
73362d0e56 EVDEV: Add shortcut functions for event types
Add wrappers around generic evdev_push_event for specific event types:
EV_KEY/EV_REL/EV_ABS etc...

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-22 22:52:50 +00:00
Oleksandr Tymoshenko
c736a75712 Implement EVDEV_FLAG_MT_AUTOREL flag (autorelease touchpoints)
Automaticaly release (send ABS_MT_TRACKING_ID = -1) MT-slots
that has not been listed in current MT protocol type B report.

Slot is counted as listed if corresponding ABS_MT_SLOT event
has been sent regardless of other MT events.

Events are sent on SYN_REPORT event.

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-08 17:59:53 +00:00
Oleksandr Tymoshenko
bfbd1bb744 Allow using of driver's mutex instead internal one for evdev locking.
Add new API call: evdev_register_mtx which takes lock argument that
should be used instead of internal one for evdev locking. Useful for
cases if evdev_push_event() is always called with driver's lock taken
and reduces amount of lock aquisitions. This allows to avoid LOR
between ev_open/ev_close invocations and evdev_push_event() Such LOR
can happen when ev_open/ev_close methods acquire driver lock and
evdev_push_event() is called with this lock taken.

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-08 17:58:26 +00:00
Oleksandr Tymoshenko
5163e77fad const-ify struct evdev_methods
Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Suggested by:	hselasky
2016-10-03 17:20:34 +00:00
Oleksandr Tymoshenko
a6b15a3429 Modularize evdev
- Convert "options EVDEV" to "device evdev" and "device uinput", add
    modules for both new devices. They are isolated subsystems and do not
    require any compile-time changes to general kernel subsytems
- For hybrid drivers that have evdev as an optional way to deliver input
    events add option EVDEV_SUPPORT. Update all existing hybrid drivers
    to use it instead of EVDEV
- Remove no-op DECLARE_MODULE in evdev, it's not required, MODULE_VERSION
    is enough
- Add evdev module dependency to uinput

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-02 03:20:31 +00:00
Oleksandr Tymoshenko
886f6623f6 Fix gcc compilation error
input_absinfo.code is unsigned so condition is always false
2016-10-02 03:06:58 +00:00
Oleksandr Tymoshenko
fa26e8edee Declare a module for evdev and add dependency to ukbd(4) and ums(4)
Prepare for making evdev a module. "Pure" evdev device drivers (like
touchscreen) and evdev itself can be built as a modules regardless of
"options EVDEV" in kernel config. So if people does not require evdev
functionality in hybrid drivers like ums and ukbd they can, for instance,
kldload evdev and utouchscreen to run FreeBSD in kiosk mode.
2016-09-30 21:04:56 +00:00
Oleksandr Tymoshenko
c3f2135cfc Handle NULL argument in evdev_free
Add check for evdev argument of evdev_free being NULL. This is valid
value and should not cause crash. In this case evdev_free does nothing

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-09-23 18:54:08 +00:00
Oleksandr Tymoshenko
e0cfa1bc82 Remove semicolon from the end of the macro definition
Reported by: hans
2016-09-12 17:29:20 +00:00
Oleksandr Tymoshenko
2b3f6d6650 Add evdev protocol implementation
evdev is a generic input event interface compatible with Linux
evdev API at ioctl level. It allows using unmodified (apart from
header name) input evdev drivers in Xorg, Wayland, Qt.

This commit has only generic kernel API. evdev support for individual
hardware drivers like ukbd, ums, atkbd, etc. will be committed later.

Project was started by Jakub Klama as part of GSoC 2014. Jakub's
evdev implementation was later used as a base, updated and finished
by Vladimir Kondratiev.

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by:	adrian, hans
Differential Revision:	https://reviews.freebsd.org/D6998
2016-09-11 18:56:38 +00:00