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.
This commit is contained in:
Oleksandr Tymoshenko 2016-09-30 21:04:56 +00:00
parent 991b5d2630
commit fa26e8edee
3 changed files with 27 additions and 0 deletions

View File

@ -33,6 +33,7 @@
#include <sys/systm.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/conf.h>
#include <sys/malloc.h>
#include <sys/bitstring.h>
@ -916,3 +917,23 @@ evdev_stop_repeat(struct evdev_dev *evdev)
evdev->ev_rep_key = KEY_RESERVED;
}
}
static int
evdev_modevent(module_t mod, int type, void *unused)
{
switch (type) {
case MOD_LOAD:
return 0;
case MOD_UNLOAD:
return 0;
}
return EINVAL;
}
static moduledata_t evdev_mod = {
"evdev",
evdev_modevent,
0
};
DECLARE_MODULE(evdev, evdev_mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
MODULE_VERSION(evdev, 1);

View File

@ -2300,5 +2300,8 @@ static driver_t ukbd_driver = {
DRIVER_MODULE(ukbd, uhub, ukbd_driver, ukbd_devclass, ukbd_driver_load, 0);
MODULE_DEPEND(ukbd, usb, 1, 1, 1);
#ifdef EVDEV
MODULE_DEPEND(ukbd, evdev, 1, 1, 1);
#endif
MODULE_VERSION(ukbd, 1);
USB_PNP_HOST_INFO(ukbd_devs);

View File

@ -1199,5 +1199,8 @@ static driver_t ums_driver = {
DRIVER_MODULE(ums, uhub, ums_driver, ums_devclass, NULL, 0);
MODULE_DEPEND(ums, usb, 1, 1, 1);
#ifdef EVDEV
MODULE_DEPEND(ums, evdev, 1, 1, 1);
#endif
MODULE_VERSION(ums, 1);
USB_PNP_HOST_INFO(ums_devs);