Ejemplo n.º 1
0
static void dwmci_set_ios(struct mmc *mmc)
{
	struct dwmci_host *host = (struct dwmci_host *)mmc->priv;
	u32 ctype;

	debug("Buswidth = %d, clock: %d\n",mmc->bus_width, mmc->clock);

	dwmci_setup_bus(host, mmc->clock);
	switch (mmc->bus_width) {
	case 8:
		ctype = DWMCI_CTYPE_8BIT;
		break;
	case 4:
		ctype = DWMCI_CTYPE_4BIT;
		break;
	default:
		ctype = DWMCI_CTYPE_1BIT;
		break;
	}

	dwmci_writel(host, DWMCI_CTYPE, ctype);

	if (host->clksel)
		host->clksel(host);
}
Ejemplo n.º 2
0
static void dwmci_set_ios(struct mci_host *mci, struct mci_ios *ios)
{
	struct dwmci_host *host = to_dwmci_host(mci);
	uint32_t ctype;

	dev_dbg(host->dev, "Buswidth = %d, clock: %d\n", ios->bus_width, ios->clock);

	if (ios->clock)
		dwmci_setup_bus(host, ios->clock);

	switch (ios->bus_width) {
	case MMC_BUS_WIDTH_8:
		ctype = DWMCI_CTYPE_8BIT;
		break;
	case MMC_BUS_WIDTH_4:
		ctype = DWMCI_CTYPE_4BIT;
		break;
	default:
		ctype = DWMCI_CTYPE_1BIT;
		break;
	}

	dwmci_writel(host, DWMCI_CTYPE, ctype);
}