diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 4d84115..7d10d39 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -230,6 +230,15 @@ config AXP_ALDO3_VOLT_SLOPE_08 endchoice +config AXP_ALDO3_INRUSH_QUIRK + bool "axp pmic (a)ldo3 inrush quirk" + depends on AXP209_POWER + default n + ---help--- + The reference design denotes a value of 4.7 uF for the output capacitor + of LDO3. Some boards have to higher capacitance than that which causes + an inrush current and causes an AXP209 shutdown. + config AXP_ALDO4_VOLT int "axp pmic (a)ldo4 voltage" depends on AXP209_POWER diff --git a/drivers/power/axp209.c b/drivers/power/axp209.c index 8a4b188..4c983d5 100644 --- a/drivers/power/axp209.c +++ b/drivers/power/axp209.c @@ -122,6 +122,28 @@ int axp_set_aldo3(unsigned int mvolt) if (rc) return rc; + /* + * On some boards, LDO3 has a to big capacitor installed. When + * turning on LDO3, this causes the AXP209 to shutdown on + * voltages over 1.9 volt. As a work around, we enable LDO3 + * first with the lowest possible voltage. If this still causes + * high inrush currents, the voltage slope should be increased. + */ +#ifdef CONFIG_AXP_ALDO3_INRUSH_QUIRK + rc = pmic_bus_read(AXP209_OUTPUT_CTRL, &cfg); + if (rc) + return rc; + + if (!(cfg & AXP209_OUTPUT_CTRL_LDO3)) { + rc = pmic_bus_write(AXP209_LDO3_VOLTAGE, 0x0); /* 0.7 Volt */ + mdelay(1); + rc |= pmic_bus_setbits(AXP209_OUTPUT_CTRL, AXP209_OUTPUT_CTRL_LDO3); + + if (rc) + return rc; + } +#endif + if (mvolt == -1) cfg = AXP209_LDO3_VOLTAGE_FROM_LDO3IN; else