omap_hsmmc: Board-specific TWL6030 MMC power initialization
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>
diff --git a/board/gumstix/duovero/duovero.c b/board/gumstix/duovero/duovero.c
index 81d6c82..1fb6b5d 100644
--- a/board/gumstix/duovero/duovero.c
+++ b/board/gumstix/duovero/duovero.c
@@ -115,8 +115,12 @@
{
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)
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c
index eb9ce63..959a23f 100644
--- a/board/ti/panda/panda.c
+++ b/board/ti/panda/panda.c
@@ -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 @@
{
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
diff --git a/board/ti/sdp4430/sdp.c b/board/ti/sdp4430/sdp.c
index 1e9ef9e..c456745 100644
--- a/board/ti/sdp4430/sdp.c
+++ b/board/ti/sdp4430/sdp.c
@@ -80,6 +80,12 @@
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
/*
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 7ee8283..afe0b06 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -96,7 +96,7 @@
}
#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 @@
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 @@
&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);