OMAP: adapt hsmmc to hwmod framework
[deliverable/linux.git] / arch / arm / mach-omap2 / devices.c
index 2f4a598ba67eb725fd092cc1c6a93870197a3ab1..31632ac1ca7c19d27dbcc470e714db0cbd0ce28f 100644 (file)
@@ -544,112 +544,6 @@ static inline void omap_init_aes(void) { }
 
 /*-------------------------------------------------------------------------*/
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
-
-#define MMCHS_SYSCONFIG                        0x0010
-#define MMCHS_SYSCONFIG_SWRESET                (1 << 1)
-#define MMCHS_SYSSTATUS                        0x0014
-#define MMCHS_SYSSTATUS_RESETDONE      (1 << 0)
-
-static struct platform_device dummy_pdev = {
-       .dev = {
-               .bus = &platform_bus_type,
-       },
-};
-
-/**
- * omap_hsmmc_reset() - Full reset of each HS-MMC controller
- *
- * Ensure that each MMC controller is fully reset.  Controllers
- * left in an unknown state (by bootloader) may prevent retention
- * or OFF-mode.  This is especially important in cases where the
- * MMC driver is not enabled, _or_ built as a module.
- *
- * In order for reset to work, interface, functional and debounce
- * clocks must be enabled.  The debounce clock comes from func_32k_clk
- * and is not under SW control, so we only enable i- and f-clocks.
- **/
-static void __init omap_hsmmc_reset(void)
-{
-       u32 i, nr_controllers;
-       struct clk *iclk, *fclk;
-
-       if (cpu_is_omap242x())
-               return;
-
-       nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC :
-               (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC);
-
-       for (i = 0; i < nr_controllers; i++) {
-               u32 v, base = 0;
-               struct device *dev = &dummy_pdev.dev;
-
-               switch (i) {
-               case 0:
-                       base = OMAP2_MMC1_BASE;
-                       break;
-               case 1:
-                       base = OMAP2_MMC2_BASE;
-                       break;
-               case 2:
-                       base = OMAP3_MMC3_BASE;
-                       break;
-               case 3:
-                       if (!cpu_is_omap44xx())
-                               return;
-                       base = OMAP4_MMC4_BASE;
-                       break;
-               case 4:
-                       if (!cpu_is_omap44xx())
-                               return;
-                       base = OMAP4_MMC5_BASE;
-                       break;
-               }
-
-               if (cpu_is_omap44xx())
-                       base += OMAP4_MMC_REG_OFFSET;
-
-               dummy_pdev.id = i;
-               dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
-               iclk = clk_get(dev, "ick");
-               if (IS_ERR(iclk))
-                       goto err1;
-               if (clk_enable(iclk))
-                       goto err2;
-
-               fclk = clk_get(dev, "fck");
-               if (IS_ERR(fclk))
-                       goto err3;
-               if (clk_enable(fclk))
-                       goto err4;
-
-               omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG);
-               v = omap_readl(base + MMCHS_SYSSTATUS);
-               while (!(omap_readl(base + MMCHS_SYSSTATUS) &
-                        MMCHS_SYSSTATUS_RESETDONE))
-                       cpu_relax();
-
-               clk_disable(fclk);
-               clk_put(fclk);
-               clk_disable(iclk);
-               clk_put(iclk);
-       }
-       return;
-
-err4:
-       clk_put(fclk);
-err3:
-       clk_disable(iclk);
-err2:
-       clk_put(iclk);
-err1:
-       printk(KERN_WARNING "%s: Unable to enable clocks for MMC%d, "
-                           "cannot reset.\n",  __func__, i);
-}
-#else
-static inline void omap_hsmmc_reset(void) {}
-#endif
-
 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
 
 static inline void omap242x_mmc_mux(struct omap_mmc_platform_data
@@ -706,67 +600,6 @@ void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
 
 #endif
 
-#if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
-
-void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
-                       int nr_controllers)
-{
-       int i;
-       char *name;
-
-       for (i = 0; i < nr_controllers; i++) {
-               unsigned long base, size;
-               unsigned int irq = 0;
-
-               if (!mmc_data[i])
-                       continue;
-
-               switch (i) {
-               case 0:
-                       base = OMAP2_MMC1_BASE;
-                       irq = INT_24XX_MMC_IRQ;
-                       break;
-               case 1:
-                       base = OMAP2_MMC2_BASE;
-                       irq = INT_24XX_MMC2_IRQ;
-                       break;
-               case 2:
-                       if (!cpu_is_omap44xx() && !cpu_is_omap34xx())
-                               return;
-                       base = OMAP3_MMC3_BASE;
-                       irq = INT_34XX_MMC3_IRQ;
-                       break;
-               case 3:
-                       if (!cpu_is_omap44xx())
-                               return;
-                       base = OMAP4_MMC4_BASE;
-                       irq = OMAP44XX_IRQ_MMC4;
-                       break;
-               case 4:
-                       if (!cpu_is_omap44xx())
-                               return;
-                       base = OMAP4_MMC5_BASE;
-                       irq = OMAP44XX_IRQ_MMC5;
-                       break;
-               default:
-                       continue;
-               }
-
-               if (cpu_is_omap44xx()) {
-                       if (i < 3)
-                               irq += OMAP44XX_IRQ_GIC_START;
-                       size = OMAP4_HSMMC_SIZE;
-                       name = "mmci-omap-hs";
-               } else {
-                       size = OMAP3_HSMMC_SIZE;
-                       name = "mmci-omap-hs";
-               }
-               omap_mmc_add(name, i, base, size, irq, mmc_data[i]);
-       };
-}
-
-#endif
-
 /*-------------------------------------------------------------------------*/
 
 #if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE)
@@ -836,7 +669,6 @@ static int __init omap2_init_devices(void)
         * please keep these calls, and their implementations above,
         * in alphabetical order so they're easier to sort through.
         */
-       omap_hsmmc_reset();
        omap_init_audio();
        omap_init_camera();
        omap_init_mbox();
This page took 0.049603 seconds and 5 git commands to generate.