omap_hsmmc: Board-specific TWL6030 MMC power initialization
authorPaul Kocialkowski <contact@paulk.fr>
Sat, 27 Feb 2016 18:18:52 +0000 (19:18 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Mar 2016 19:11:29 +0000 (15:11 -0400)
Boards using the TWL6030 regulator may not all use the LDOs the same way.
Some might also not use MMC1 at all, so VMMC would't have to be enabled.

This delegates TWL6030 MMC power initializations to board-specific functions,
that may still call twl6030_power_mmc_init for the default behavior.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
board/gumstix/duovero/duovero.c
board/ti/panda/panda.c
board/ti/sdp4430/sdp.c
drivers/mmc/omap_hsmmc.c

index 81d6c822191ae4add2840d6c57d27d06f032a6cb..1fb6b5db4eb6c0bf74f5051c1614544d7dec7a6c 100644 (file)
@@ -115,8 +115,12 @@ int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
 }
-#endif
 
+void board_mmc_power_init(void)
+{
+       twl6030_power_mmc_init(0);
+}
+#endif
 
 #if defined(CONFIG_CMD_NET)
 
index eb9ce630dceb7eabc4bddf24910acaa61d28d761..959a23f749b82e484d3bbb34898da1da2a880457 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/gpio.h>
 #include <asm/gpio.h>
+#include <twl6030.h>
 
 #include "panda_mux_data.h"
 
@@ -291,6 +292,11 @@ int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
 }
+
+void board_mmc_power_init(void)
+{
+       twl6030_power_mmc_init(0);
+}
 #endif
 
 #ifdef CONFIG_USB_EHCI
index 1e9ef9e38b0d685c23bbbd89f2d42253fab5b54e..c45674509b15af7886c1277980c005b3a01dd373 100644 (file)
@@ -80,6 +80,12 @@ int board_mmc_init(bd_t *bis)
        omap_mmc_init(1, 0, 0, -1, -1);
        return 0;
 }
+
+void board_mmc_power_init(void)
+{
+       twl6030_power_mmc_init(0);
+       twl6030_power_mmc_init(1);
+}
 #endif
 
 /*
index 7ee8283ae2dcc20a2ff4ed45de9d34729ce4bd60..afe0b0646d352ef348fe564908ff1c4f8b0e164c 100644 (file)
@@ -96,7 +96,7 @@ static int omap_mmc_setup_gpio_in(int gpio, const char *label)
 }
 #endif
 
-#if defined(CONFIG_OMAP44XX) && defined(CONFIG_TWL6030_POWER)
+#if defined(CONFIG_OMAP44XX)
 static void omap4_vmmc_pbias_config(struct mmc *mmc)
 {
        u32 value = 0;
@@ -104,8 +104,6 @@ static void omap4_vmmc_pbias_config(struct mmc *mmc)
        value = readl((*ctrl)->control_pbiaslite);
        value &= ~(MMC1_PBIASLITE_PWRDNZ | MMC1_PWRDNZ);
        writel(value, (*ctrl)->control_pbiaslite);
-       twl6030_power_mmc_init(0);
-       twl6030_power_mmc_init(1);
        value = readl((*ctrl)->control_pbiaslite);
        value |= MMC1_PBIASLITE_VMODE | MMC1_PBIASLITE_PWRDNZ | MMC1_PWRDNZ;
        writel(value, (*ctrl)->control_pbiaslite);
@@ -175,7 +173,7 @@ static unsigned char mmc_board_init(struct mmc *mmc)
                &prcm_base->iclken1_core);
 #endif
 
-#if defined(CONFIG_OMAP44XX) && defined(CONFIG_TWL6030_POWER)
+#if defined(CONFIG_OMAP44XX)
        /* PBIAS config needed for MMC1 only */
        if (mmc->block_dev.devnum == 0)
                omap4_vmmc_pbias_config(mmc);