summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2016-10-22 16:24:12 +0000
committergonzo <gonzo@FreeBSD.org>2016-10-22 16:24:12 +0000
commit797c95b142be87731cfeb6bb6f2268e2218742cf (patch)
treedc9f8c81f602b3e290dc70aa07ba06cd861a9ecc
parent91a5c089a3cdc551d5461528054a53caa39434bd (diff)
downloadFreeBSD-src-797c95b142be87731cfeb6bb6f2268e2218742cf.zip
FreeBSD-src-797c95b142be87731cfeb6bb6f2268e2218742cf.tar.gz
MFC r306618, r306619
r306618: Fix attach/detach methods - Initialize lock before starting worker process - Do not hold lock when destroying evdev. By that time ther should be no other active code pathes that can access softc r306619: Add rpi_ft5406 module and add it to extra modules in Raspberry Pi configs
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_ft5406.c7
-rw-r--r--sys/arm/conf/RPI-B2
-rw-r--r--sys/arm/conf/RPI22
-rw-r--r--sys/modules/rpi_ft5406/Makefile10
4 files changed, 16 insertions, 5 deletions
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c b/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c
index 73a5f31..ccd4753 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c
@@ -288,13 +288,13 @@ ft5406ts_attach(device_t dev)
sc->sc_init_hook.ich_func = ft5406ts_init;
sc->sc_init_hook.ich_arg = sc;
+ FT5406_LOCK_INIT(sc);
+
if (config_intrhook_establish(&sc->sc_init_hook) != 0) {
device_printf(dev, "config_intrhook_establish failed\n");
return (ENOMEM);
}
- FT5406_LOCK_INIT(sc);
-
return (0);
}
@@ -308,10 +308,11 @@ ft5406ts_detach(device_t dev)
FT5406_LOCK(sc);
if (sc->sc_worker)
sc->sc_detaching = 1;
+ wakeup(sc);
+ FT5406_UNLOCK(sc);
if (sc->sc_evdev)
evdev_free(sc->sc_evdev);
- FT5406_UNLOCK(sc);
FT5406_LOCK_DESTROY(sc);
diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B
index 58d05ca..5e8aee2 100644
--- a/sys/arm/conf/RPI-B
+++ b/sys/arm/conf/RPI-B
@@ -94,4 +94,4 @@ options FDT # Configure using FDT/DTB data
# handed to kernel via U-Boot and ubldr.
#options FDT_DTB_STATIC
#makeoptions FDT_DTS_FILE=rpi.dts
-makeoptions MODULES_EXTRA=dtb/rpi
+makeoptions MODULES_EXTRA="dtb/rpi rpi_ft5406"
diff --git a/sys/arm/conf/RPI2 b/sys/arm/conf/RPI2
index 75e1b7e..82293ad 100644
--- a/sys/arm/conf/RPI2
+++ b/sys/arm/conf/RPI2
@@ -98,4 +98,4 @@ options FDT # Configure using FDT/DTB data
# handed to kernel via U-Boot and ubldr.
#options FDT_DTB_STATIC
#makeoptions FDT_DTS_FILE=rpi2.dts
-makeoptions MODULES_EXTRA=dtb/rpi
+makeoptions MODULES_EXTRA="dtb/rpi rpi_ft5406"
diff --git a/sys/modules/rpi_ft5406/Makefile b/sys/modules/rpi_ft5406/Makefile
new file mode 100644
index 0000000..2360ced
--- /dev/null
+++ b/sys/modules/rpi_ft5406/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../arm/broadcom/bcm2835/
+
+KMOD= rpi_ft5406
+SRCS= bcm2835_ft5406.c
+
+SRCS+= bus_if.h device_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud