mmc: dw_mmc: support DDR mode
[deliverable/linux.git] / drivers / mmc / host / dw_mmc.c
index 62c8440ff04b980e82976368730accc3d115b09b..58476c1bb0562f1f49afe345fa5032e8d93b6b43 100644 (file)
@@ -662,6 +662,7 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 {
        struct dw_mci_slot *slot = mmc_priv(mmc);
+       u32 regs;
 
        /* set default 1 bit mode */
        slot->ctype = SDMMC_CTYPE_1BIT;
@@ -678,6 +679,13 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                break;
        }
 
+       /* DDR mode set */
+       if (ios->ddr) {
+               regs = mci_readl(slot->host, UHS_REG);
+               regs |= (0x1 << slot->id) << 16;
+               mci_writel(slot->host, UHS_REG, regs);
+       }
+
        if (ios->clock) {
                /*
                 * Use mirror of ios->clock to prevent race with mmc
This page took 0.030043 seconds and 5 git commands to generate.