ARM: OMAP: fix MMC2 loopback clock handling
authorGrazvydas Ignotas <notasas@gmail.com>
Thu, 12 Jan 2012 14:26:45 +0000 (16:26 +0200)
committerTony Lindgren <tony@atomide.com>
Fri, 27 Jan 2012 00:38:47 +0000 (16:38 -0800)
Currently MMC2 setup code can only enable loopback clock and
relies on reset value for boards that need to have it disabled.
This causes a problem with certain bootloaders that always enable
that clock, resulting with unwanted bootloader dependencies.

Fix this by making it disable the clock if board data says so.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/hsmmc.c

index 8658bd77763cc7c25849f6fc84a3de7491819700..ad0adb5a1e0eb62b025abc56006d068f92771d32 100644 (file)
@@ -175,11 +175,12 @@ static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc)
 {
        u32 reg;
 
-       if (mmc->slots[0].internal_clock) {
-               reg = omap_ctrl_readl(control_devconf1_offset);
+       reg = omap_ctrl_readl(control_devconf1_offset);
+       if (mmc->slots[0].internal_clock)
                reg |= OMAP2_MMCSDIO2ADPCLKISEL;
-               omap_ctrl_writel(reg, control_devconf1_offset);
-       }
+       else
+               reg &= ~OMAP2_MMCSDIO2ADPCLKISEL;
+       omap_ctrl_writel(reg, control_devconf1_offset);
 }
 
 static void hsmmc2_before_set_reg(struct device *dev, int slot,