Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Oct 2006 05:45:30 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 107030 for review
Message-ID:  <200610010545.k915jUho069832@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=107030

Change 107030 by imp@imp_lighthouse on 2006/10/01 05:45:06

	For each SD card we find, add it to the device tree.

Affected files ...

.. //depot/projects/arm/src/sys/dev/mmc/mmc.c#12 edit

Differences ...

==== //depot/projects/arm/src/sys/dev/mmc/mmc.c#12 (text+ko) ====

@@ -452,6 +452,7 @@
 	struct mmc_ivars *ivar;
 	int err;
 	uint32_t resp;
+	device_t child;
 
 	while (1) {
 		ivar = malloc(sizeof(struct mmc_ivars), M_DEVBUF, M_WAITOK);
@@ -471,6 +472,8 @@
 			mmc_send_csd(sc, ivar->rca, ivar->raw_csd);
 			mmc_decode_csd(1, ivar->raw_csd, &ivar->csd);
 			printf("SD CARD: %lld bytes\n", ivar->csd.capacity);
+			child = device_add_child(sc->dev, NULL, -1);
+			device_set_ivars(child, ivar);
 			break;
 		}
 		panic("Write MMC card code here");
@@ -523,13 +526,15 @@
 
 	mmcbr_set_bus_mode(dev, pushpull);
 	mmcbr_update_ios(dev);
+	bus_generic_attach(dev);
+//	mmc_update_children_sysctl(dev);
 }
 
 static int
 mmc_calculate_clock(struct mmc_softc *sc)
 {
-	// XXX write me
-	return 0;
+    // xxx
+    return 0;
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610010545.k915jUho069832>