Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mmc/mmc_fdt_helpers.c
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | if (OF_hasprop(node, "mmc-hs400-enhanced-strobe")) | ||||
host->caps |= MMC_CAP_MMC_ENH_STROBE; | host->caps |= MMC_CAP_MMC_ENH_STROBE; | ||||
} | } | ||||
int | int | ||||
mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_helper *helper, | mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_helper *helper, | ||||
struct mmc_host *host) | struct mmc_host *host) | ||||
{ | { | ||||
uint32_t bus_width; | uint32_t bus_width; | ||||
phandle_t pwrseq_xref; | |||||
if (node <= 0) | if (node <= 0) | ||||
node = ofw_bus_get_node(dev); | node = ofw_bus_get_node(dev); | ||||
if (node <= 0) | if (node <= 0) | ||||
return (ENXIO); | return (ENXIO); | ||||
if (OF_getencprop(node, "bus-width", &bus_width, sizeof(uint32_t)) <= 0) | if (OF_getencprop(node, "bus-width", &bus_width, sizeof(uint32_t)) <= 0) | ||||
bus_width = 1; | bus_width = 1; | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | else | ||||
MMC_CAP_UHS_SDR50 | | MMC_CAP_UHS_SDR50 | | ||||
MMC_CAP_UHS_SDR25); | MMC_CAP_UHS_SDR25); | ||||
if (regulator_check_voltage(helper->vqmmc_supply, 3300000) == 0) | if (regulator_check_voltage(helper->vqmmc_supply, 3300000) == 0) | ||||
host->caps |= MMC_CAP_SIGNALING_330; | host->caps |= MMC_CAP_SIGNALING_330; | ||||
} else | } else | ||||
host->caps |= MMC_CAP_SIGNALING_330; | host->caps |= MMC_CAP_SIGNALING_330; | ||||
#endif | #endif | ||||
if (OF_hasprop(node, "mmc-pwrseq")) { | |||||
if (OF_getencprop(node, "mmc-pwrseq", &pwrseq_xref, sizeof(pwrseq_xref)) == -1) { | |||||
device_printf(dev, "Cannot get the pwrseq_xref property\n"); | |||||
return (ENXIO); | |||||
} | |||||
helper->mmc_pwrseq = OF_device_from_xref(pwrseq_xref); | |||||
} | |||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Card detect interrupt handler. | * Card detect interrupt handler. | ||||
*/ | */ | ||||
static void | static void | ||||
cd_intr(void *arg) | cd_intr(void *arg) | ||||
▲ Show 20 Lines • Show All 226 Lines • Show Last 20 Lines |