summaryrefslogtreecommitdiffstats
path: root/sys/arm/ti
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2016-10-22 15:26:32 +0000
committergonzo <gonzo@FreeBSD.org>2016-10-22 15:26:32 +0000
commit91a5c089a3cdc551d5461528054a53caa39434bd (patch)
tree14ebee2d33dc1ec879bda17dafb73446c09a0af2 /sys/arm/ti
parent7c7b3affd93245289893038d162844ffca532dff (diff)
downloadFreeBSD-src-91a5c089a3cdc551d5461528054a53caa39434bd.zip
FreeBSD-src-91a5c089a3cdc551d5461528054a53caa39434bd.tar.gz
MFC r306530, r306531, r306532, r306579:
r306530: 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. r306531: Add dependency to evdev module (if required) r306532: Add dependency to evdev module r306579: 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>
Diffstat (limited to 'sys/arm/ti')
-rw-r--r--sys/arm/ti/ti_adc.c17
-rw-r--r--sys/arm/ti/ti_adcvar.h2
2 files changed, 11 insertions, 8 deletions
diff --git a/sys/arm/ti/ti_adc.c b/sys/arm/ti/ti_adc.c
index a99d27e..154cd78 100644
--- a/sys/arm/ti/ti_adc.c
+++ b/sys/arm/ti/ti_adc.c
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
#include <dev/evdev/input.h>
#include <dev/evdev/evdev.h>
#endif
@@ -89,7 +89,7 @@ static int ti_adc_samples[5] = { 0, 2, 4, 8, 16 };
static int ti_adc_detach(device_t dev);
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
static void
ti_adc_ev_report(struct ti_adc_softc *sc)
{
@@ -472,7 +472,7 @@ ti_adc_tsc_read_data(struct ti_adc_softc *sc)
device_printf(sc->sc_dev, "touchscreen x: %d, y: %d\n", x, y);
#endif
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
if ((sc->sc_x != x) || (sc->sc_y != y)) {
sc->sc_x = x;
sc->sc_y = y;
@@ -516,7 +516,7 @@ ti_adc_intr(void *arg)
status |= ADC_IRQ_HW_PEN_ASYNC;
ADC_WRITE4(sc, ADC_IRQENABLE_CLR,
ADC_IRQ_HW_PEN_ASYNC);
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
ti_adc_ev_report(sc);
#endif
}
@@ -524,7 +524,7 @@ ti_adc_intr(void *arg)
if (rawstatus & ADC_IRQ_PEN_UP) {
sc->sc_pen_down = 0;
status |= ADC_IRQ_PEN_UP;
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
ti_adc_ev_report(sc);
#endif
}
@@ -874,7 +874,7 @@ ti_adc_attach(device_t dev)
ti_adc_setup(sc);
TI_ADC_UNLOCK(sc);
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
if (sc->sc_tsc_wires > 0) {
sc->sc_evdev = evdev_alloc();
evdev_set_name(sc->sc_evdev, device_get_desc(dev));
@@ -921,7 +921,7 @@ ti_adc_detach(device_t dev)
ti_adc_reset(sc);
ti_adc_setup(sc);
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
evdev_free(sc->sc_evdev);
#endif
@@ -958,3 +958,6 @@ static devclass_t ti_adc_devclass;
DRIVER_MODULE(ti_adc, simplebus, ti_adc_driver, ti_adc_devclass, 0, 0);
MODULE_VERSION(ti_adc, 1);
MODULE_DEPEND(ti_adc, simplebus, 1, 1, 1);
+#ifdef EVDEV_SUPPORT
+MODULE_DEPEND(ti_adc, evdev, 1, 1, 1);
+#endif
diff --git a/sys/arm/ti/ti_adcvar.h b/sys/arm/ti/ti_adcvar.h
index 012e1ce..b9cc0f0 100644
--- a/sys/arm/ti/ti_adcvar.h
+++ b/sys/arm/ti/ti_adcvar.h
@@ -55,7 +55,7 @@ struct ti_adc_softc {
int sc_yn_bit, sc_yn_inp;
uint32_t sc_tsc_enabled;
int sc_pen_down;
-#ifdef EVDEV
+#ifdef EVDEV_SUPPORT
int sc_x;
int sc_y;
struct evdev_dev *sc_evdev;
OpenPOWER on IntegriCloud