Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/omap Defer configuring children of obio until a...



details:   https://anonhg.NetBSD.org/src/rev/f6d1470028e5
branches:  trunk
changeset: 783206:f6d1470028e5
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Dec 11 01:33:32 2012 +0000

description:
Defer configuring children of obio until all obio are attached.
from jmcneill.

diffstat:

 sys/arch/arm/omap/omap2_obio.c |  26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diffs (64 lines):

diff -r 57b7daab04ab -r f6d1470028e5 sys/arch/arm/omap/omap2_obio.c
--- a/sys/arch/arm/omap/omap2_obio.c    Tue Dec 11 01:16:10 2012 +0000
+++ b/sys/arch/arm/omap/omap2_obio.c    Tue Dec 11 01:33:32 2012 +0000
@@ -1,7 +1,7 @@
-/*     $Id: omap2_obio.c,v 1.14 2012/09/05 00:19:59 matt Exp $ */
+/*     $Id: omap2_obio.c,v 1.15 2012/12/11 01:33:32 matt Exp $ */
 
 /* adapted from: */
-/*     $NetBSD: omap2_obio.c,v 1.14 2012/09/05 00:19:59 matt Exp $ */
+/*     $NetBSD: omap2_obio.c,v 1.15 2012/12/11 01:33:32 matt Exp $ */
 
 
 /*
@@ -103,7 +103,7 @@
 
 #include "opt_omap.h"
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.14 2012/09/05 00:19:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.15 2012/12/11 01:33:32 matt Exp $");
 
 #include "locators.h"
 #include "obio.h"
@@ -181,6 +181,15 @@
 }
 
 static void
+obio_attach1(device_t self)
+{
+       /*
+        * Attach the rest of our devices
+        */
+       config_search_ia(obio_search, self, "obio", NULL);
+}
+
+static void
 obio_attach(device_t parent, device_t self, void *aux)
 {
        struct obio_softc *sc = device_private(self);
@@ -219,9 +228,10 @@
        obio_attach_critical(sc);
 
        /*
-        * Then attach the rest of our devices
+        * Attach the rest of our devices once all obio devices
+        * have attached.
         */
-       config_search_ia(obio_search, self, "obio", NULL);
+       config_defer(self, obio_attach1);
 }
 
 static int
@@ -348,6 +358,12 @@
        { .name = "gpio1", .addr = GPIO1_BASE, .required = false },
        { .name = "gpio2", .addr = GPIO2_BASE, .required = false },
        { .name = "gpio3", .addr = GPIO3_BASE, .required = false },
+#if defined(GPIO4_BASE)
+       { .name = "gpio4", .addr = GPIO4_BASE, .required = false },
+#endif
+#if defined(GPIO5_BASE)
+       { .name = "gpio5", .addr = GPIO5_BASE, .required = false },
+#endif
 #if 0
        { .name = "dmac", .addr = DMAC_BASE, .required = true },
 #endif



Home | Main Index | Thread Index | Old Index