X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fpower%2Fpalmas.c;h=c813b21e6f1ef97f390477eed546b72e87dc8814;hb=10fa3ee09b4219e96128bf56b380a47a2b905134;hp=c7b0cbe8b598d8c750b62db10da91e04002bc901;hpb=8b485ba12b0defa0c4ed3559789250238f8331a8;p=u-boot diff --git a/drivers/power/palmas.c b/drivers/power/palmas.c index c7b0cbe8b5..c813b21e6f 100644 --- a/drivers/power/palmas.c +++ b/drivers/power/palmas.c @@ -23,25 +23,47 @@ void palmas_init_settings(void) #endif } -int palmas_mmc1_poweron_ldo(void) +#if defined(CONFIG_OMAP54XX) +int lp873x_mmc1_poweron_ldo(uint voltage) +{ + if (palmas_i2c_write_u8(LP873X_LDO1_ADDR, LP873X_LDO1_VOLTAGE, + voltage)) { + printf("lp873x: could not set LDO1 voltage.\n"); + return 1; + } + /* TURN ON LDO1 */ + if (palmas_i2c_write_u8(LP873X_LDO1_ADDR, LP873X_LDO1_CTRL, + LP873X_LDO_CTRL_EN | LP873X_LDO_CTRL_RDIS_EN)) { + printf("lp873x: could not turn on LDO1.\n"); + return 1; + } + return 0; + +} +#endif + +int palmas_mmc1_poweron_ldo(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 */ val = LDO_VOLT_3V0; - if (palmas_i2c_write_u8(TPS65903X_CHIP_P1, LDO1_VOLTAGE, val)) { + ret = palmas_i2c_write_u8(TPS65903X_CHIP_P1, LDO1_VOLTAGE, val); + if (ret) { printf("tps65903x: could not set LDO1 voltage.\n"); - return 1; + return ret; } /* TURN ON LDO1 */ val = RSC_MODE_SLEEP | RSC_MODE_ACTIVE; - if (palmas_i2c_write_u8(TPS65903X_CHIP_P1, LDO1_CTRL, val)) { + ret = palmas_i2c_write_u8(TPS65903X_CHIP_P1, LDO1_CTRL, val); + if (ret) { printf("tps65903x: could not turn on LDO1.\n"); - return 1; + return ret; } return 0; #else @@ -127,6 +149,21 @@ int twl603x_audio_power(u8 on) } #endif +#ifdef CONFIG_PALMAS_USB_SS_PWR +/** + * @brief palmas_enable_ss_ldo - Configure EVM board specific configurations + * for the USB Super speed SMPS10 regulator. + * + * @return 0 + */ +int palmas_enable_ss_ldo(void) +{ + /* Enable smps10 regulator */ + return palmas_i2c_write_u8(TWL603X_CHIP_P1, SMPS10_CTRL, + SMPS10_MODE_ACTIVE_D); +} +#endif + /* * Enable/disable back-up battery (or super cap) charging on TWL6035/37. * Please use defined BB_xxx values.