Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mmc/host/dwmmc.c
Show First 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
dwmmc_probe(device_t dev) | dwmmc_probe(device_t dev) | ||||
{ | { | ||||
uintptr_t hwtype; | uintptr_t hwtype; | ||||
if (!ofw_bus_status_okay(dev)) | if (!ofw_bus_status_okay(dev)) | ||||
return (ENXIO); | return (ENXIO); | ||||
hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; | if (!ofw_bus_compatible_lookup(dev, compat_data)) | ||||
if (hwtype == HWTYPE_NONE) | |||||
return (ENXIO); | return (ENXIO); | ||||
device_set_desc(dev, "Synopsys DesignWare Mobile " | device_set_desc(dev, "Synopsys DesignWare Mobile " | ||||
"Storage Host Controller"); | "Storage Host Controller"); | ||||
return (BUS_PROBE_DEFAULT); | return (BUS_PROBE_DEFAULT); | ||||
} | } | ||||
int | int | ||||
dwmmc_attach(device_t dev) | dwmmc_attach(device_t dev) | ||||
{ | { | ||||
struct dwmmc_softc *sc; | struct dwmmc_softc *sc; | ||||
int error; | int error; | ||||
int slot; | int slot; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
sc->dev = dev; | sc->dev = dev; | ||||
if (sc->hwtype == HWTYPE_NONE) { | if (sc->hwtype == HWTYPE_NONE) { | ||||
sc->hwtype = | sc->hwtype = | ||||
ofw_bus_search_compatible(dev, compat_data)->ocd_data; | ofw_bus_compatible_lookup(dev, compat_data)->ocd_data; | ||||
} | } | ||||
/* Why not to use Auto Stop? It save a hundred of irq per second */ | /* Why not to use Auto Stop? It save a hundred of irq per second */ | ||||
sc->use_auto_stop = 1; | sc->use_auto_stop = 1; | ||||
error = parse_fdt(sc); | error = parse_fdt(sc); | ||||
if (error != 0) { | if (error != 0) { | ||||
device_printf(dev, "Can't get FDT property.\n"); | device_printf(dev, "Can't get FDT property.\n"); | ||||
▲ Show 20 Lines • Show All 662 Lines • Show Last 20 Lines |