twl4030: device-index-specific MMC power initializations, common ramp-up delay

Not every device has multiple MMC slots available, so it makes sense to enable
only the required LDOs for the available slots. Generic code in omap_hsmmc will
enable both VMMC1 and VMMC2, in doubt.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@ti.com>
This commit is contained in:
Paul Kocialkowski 2014-11-08 20:55:46 +01:00 committed by Tom Rini
parent 95de9ab201
commit f3e85e4825
3 changed files with 20 additions and 14 deletions
drivers
include

View File

@ -137,8 +137,8 @@ static unsigned char mmc_board_init(struct mmc *mmc)
writel(pbias_lite, &t2_base->pbias_lite); writel(pbias_lite, &t2_base->pbias_lite);
#endif #endif
#if defined(CONFIG_TWL4030_POWER) #if defined(CONFIG_TWL4030_POWER)
twl4030_power_mmc_init(); twl4030_power_mmc_init(0);
mdelay(100); /* ramp-up delay from Linux code */ twl4030_power_mmc_init(1);
#endif #endif
#if defined(CONFIG_OMAP34XX) #if defined(CONFIG_OMAP34XX)
writel(pbias_lite | PBIASLITEPWRDNZ1 | writel(pbias_lite | PBIASLITEPWRDNZ1 |

View File

@ -91,17 +91,23 @@ void twl4030_power_init(void)
TWL4030_PM_RECEIVER_DEV_GRP_P1); TWL4030_PM_RECEIVER_DEV_GRP_P1);
} }
void twl4030_power_mmc_init(void) void twl4030_power_mmc_init(int dev_index)
{ {
/* Set VMMC1 to 3.15 Volts */ if (dev_index == 0) {
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VMMC1_DEDICATED, /* Set VMMC1 to 3.15 Volts */
TWL4030_PM_RECEIVER_VMMC1_VSEL_32, twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VMMC1_DEDICATED,
TWL4030_PM_RECEIVER_VMMC1_DEV_GRP, TWL4030_PM_RECEIVER_VMMC1_VSEL_32,
TWL4030_PM_RECEIVER_DEV_GRP_P1); TWL4030_PM_RECEIVER_VMMC1_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
/* Set VMMC2 to 3.15 Volts */ mdelay(100); /* ramp-up delay from Linux code */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VMMC2_DEDICATED, } else if (dev_index == 1) {
TWL4030_PM_RECEIVER_VMMC2_VSEL_32, /* Set VMMC2 to 3.15 Volts */
TWL4030_PM_RECEIVER_VMMC2_DEV_GRP, twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VMMC2_DEDICATED,
TWL4030_PM_RECEIVER_DEV_GRP_P1); TWL4030_PM_RECEIVER_VMMC2_VSEL_32,
TWL4030_PM_RECEIVER_VMMC2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
mdelay(100); /* ramp-up delay from Linux code */
}
} }

View File

@ -651,7 +651,7 @@ void twl4030_pmrecv_vsel_cfg(u8 vsel_reg, u8 vsel_val,
/* For initializing power device */ /* For initializing power device */
void twl4030_power_init(void); void twl4030_power_init(void);
/* For initializing mmc power */ /* For initializing mmc power */
void twl4030_power_mmc_init(void); void twl4030_power_mmc_init(int dev_index);
/* /*
* LED * LED