OSDN Git Service

mmc: dw_mmc: Clear the DDR mode for non-DDR
authorSeungwon Jeon <tgih.jun@samsung.com>
Mon, 2 Jan 2012 07:00:02 +0000 (16:00 +0900)
committerChris Ball <cjb@laptop.org>
Thu, 12 Jan 2012 20:17:08 +0000 (15:17 -0500)
UHS_REG should be cleared for non-DDR mode. But currently there is
no way to clear DDR mode, if it is already set once. This patch adds
clearing DDR mode for non-DDR mode.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/dw_mmc.c

index c583b94..94e2238 100644 (file)
@@ -707,12 +707,15 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                break;
        }
 
+       regs = mci_readl(slot->host, UHS_REG);
+
        /* DDR mode set */
-       if (ios->timing == MMC_TIMING_UHS_DDR50) {
-               regs = mci_readl(slot->host, UHS_REG);
+       if (ios->timing == MMC_TIMING_UHS_DDR50)
                regs |= (0x1 << slot->id) << 16;
-               mci_writel(slot->host, UHS_REG, regs);
-       }
+       else
+               regs &= ~(0x1 << slot->id) << 16;
+
+       mci_writel(slot->host, UHS_REG, regs);
 
        if (ios->clock) {
                /*