aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLokesh Vutla2017-08-21 12:50:50 +0530
committerTom Rini2017-09-11 16:19:37 -0400
commitdb4fce8fcd87ba139a8c4fb0d9c57f3d70b6116c (patch)
tree211c5992c8343158dd4a1167997cb00d473aa2ca
parent91d3e90668009a9d0175f03fe0daf5285b78c6ba (diff)
palmas: Add support for powering different ldos
It is not necessary that ldo1 is used to power on mmc. So, add support for passing ldo registers for powering on mmc. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
-rw-r--r--arch/arm/mach-omap2/omap5/hwinit.c2
-rw-r--r--board/ti/dra7xx/evm.c2
-rw-r--r--drivers/power/palmas.c11
-rw-r--r--include/palmas.h2
4 files changed, 7 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/omap5/hwinit.c b/arch/arm/mach-omap2/omap5/hwinit.c
index cb2a5ab7eaa..85d3518e943 100644
--- a/arch/arm/mach-omap2/omap5/hwinit.c
+++ b/arch/arm/mach-omap2/omap5/hwinit.c
@@ -457,7 +457,7 @@ void v7_arch_cp15_set_acr(u32 acr, u32 cpu_midr, u32 cpu_rev_comb,
#if defined(CONFIG_PALMAS_POWER)
__weak void board_mmc_poweron_ldo(uint voltage)
{
- palmas_mmc1_poweron_ldo(voltage);
+ palmas_mmc1_poweron_ldo(LDO1_VOLTAGE, LDO1_CTRL, voltage);
}
void vmmc_pbias_config(uint voltage)
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 6767fd21792..1c0a1eb0521 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -720,7 +720,7 @@ void board_mmc_poweron_ldo(uint voltage)
voltage = 0xa;
lp873x_mmc1_poweron_ldo(voltage);
} else {
- palmas_mmc1_poweron_ldo(voltage);
+ palmas_mmc1_poweron_ldo(LDO1_VOLTAGE, LDO1_CTRL, voltage);
}
}
#endif
diff --git a/drivers/power/palmas.c b/drivers/power/palmas.c
index 4e9895987cb..ddf777c26b1 100644
--- a/drivers/power/palmas.c
+++ b/drivers/power/palmas.c
@@ -42,24 +42,21 @@ int lp873x_mmc1_poweron_ldo(uint voltage)
}
#endif
-int palmas_mmc1_poweron_ldo(uint voltage)
+int palmas_mmc1_poweron_ldo(uint ldo_volt, uint ldo_ctrl, uint voltage)
{
u8 val = 0;
#if defined(CONFIG_DRA7XX)
int ret;
- /*
- * Currently valid for the dra7xx_evm board:
- * Set TPS659038 LDO1 to 3.0 V or 1.8V
- */
- ret = palmas_i2c_write_u8(TPS65903X_CHIP_P1, LDO1_VOLTAGE, voltage);
+
+ ret = palmas_i2c_write_u8(TPS65903X_CHIP_P1, ldo_volt, voltage);
if (ret) {
printf("tps65903x: could not set LDO1 voltage.\n");
return ret;
}
/* TURN ON LDO1 */
val = RSC_MODE_SLEEP | RSC_MODE_ACTIVE;
- ret = palmas_i2c_write_u8(TPS65903X_CHIP_P1, LDO1_CTRL, val);
+ ret = palmas_i2c_write_u8(TPS65903X_CHIP_P1, ldo_ctrl, val);
if (ret) {
printf("tps65903x: could not turn on LDO1.\n");
return ret;
diff --git a/include/palmas.h b/include/palmas.h
index d676617344c..404c2b3ca7b 100644
--- a/include/palmas.h
+++ b/include/palmas.h
@@ -129,7 +129,7 @@ static inline int palmas_i2c_read_u8(u8 chip_no, u8 reg, u8 *val)
}
void palmas_init_settings(void);
-int palmas_mmc1_poweron_ldo(uint voltage);
+int palmas_mmc1_poweron_ldo(uint ldo_volt, uint ldo_ctrl, uint voltage);
int lp873x_mmc1_poweron_ldo(uint voltage);
int twl603x_mmc1_set_ldo9(u8 vsel);
int twl603x_audio_power(u8 on);