]> git.sur5r.net Git - u-boot/blobdiff - drivers/power/palmas.c
cfi_flash: Fix whitespace with casting
[u-boot] / drivers / power / palmas.c
index c7b0cbe8b598d8c750b62db10da91e04002bc901..ddf777c26b16da15e6a08615d2a5724dfb347e6c 100644 (file)
@@ -23,25 +23,43 @@ 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 ldo_volt, uint ldo_ctrl, uint voltage)
 {
        u8 val = 0;
 
 #if defined(CONFIG_DRA7XX)
-       /*
-        * 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)) {
+       int ret;
+
+       ret = palmas_i2c_write_u8(TPS65903X_CHIP_P1, ldo_volt, voltage);
+       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, ldo_ctrl, val);
+       if (ret) {
                printf("tps65903x: could not turn on LDO1.\n");
-               return 1;
+               return ret;
        }
        return 0;
 #else
@@ -127,6 +145,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.