[BACK]Return to sdmmc.c CVS log [TXT][DIR] Up to [local] / funnyos / dev / sdmmc

File: [local] / funnyos / dev / sdmmc / sdmmc.c (download)

Revision 1.3, Tue Dec 25 14:10:51 2007 UTC (16 years, 4 months ago) by nbrk
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +34 -12 lines

shuffle code around; sdmmc.c now MI device.
in sdmmc_spi.c shrink ugly code and start implementing new backends for sdmmc_bus_handle.
to be done

/*
 * $Id: sdmmc.c,v 1.3 2007/12/25 14:10:51 nbrk Exp $
 */
#include <sys/types.h>
#include <sys/device.h>
#include <dev/sdmmc/sdmmcvar.h>

#include <libkern/printf.h>

/*
 * SD/MMC device.
 */
struct sdmmc_dd {
	struct sdmmc_bus_handle *sd_sbhp;

};

int 	sdmmc_attach(struct device *, uint32_t, uint8_t);



struct driver sdmmc_dr = {
	sizeof(struct sdmmc_dd),
	sdmmc_attach,
	NULL,
	NULL
};


int
sdmmc_attach(struct device *self, uint32_t loc, uint8_t flags)
{
	struct sdmmc_dd *ddp = self->dv_devdata;
	ddp->sd_sbhp = self->dv_parent->dv_aux;

	printf("SD/MMC generic device\n");

	sdmmc_init(ddp->sd_sbhp);

	return(0);
}