svn commit: r306530 - in head/sys/dev: evdev usb/input

Oleksandr Tymoshenko gonzo at FreeBSD.org
Fri Sep 30 21:04:58 UTC 2016


Author: gonzo
Date: Fri Sep 30 21:04:56 2016
New Revision: 306530
URL: https://svnweb.freebsd.org/changeset/base/306530

Log:
  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.

Modified:
  head/sys/dev/evdev/evdev.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/input/ums.c

Modified: head/sys/dev/evdev/evdev.c
==============================================================================
--- head/sys/dev/evdev/evdev.c	Fri Sep 30 21:00:09 2016	(r306529)
+++ head/sys/dev/evdev/evdev.c	Fri Sep 30 21:04:56 2016	(r306530)
@@ -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 *evde
 		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);

Modified: head/sys/dev/usb/input/ukbd.c
==============================================================================
--- head/sys/dev/usb/input/ukbd.c	Fri Sep 30 21:00:09 2016	(r306529)
+++ head/sys/dev/usb/input/ukbd.c	Fri Sep 30 21:04:56 2016	(r306530)
@@ -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);

Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c	Fri Sep 30 21:00:09 2016	(r306529)
+++ head/sys/dev/usb/input/ums.c	Fri Sep 30 21:04:56 2016	(r306530)
@@ -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);


More information about the svn-src-all mailing list