The dcdc3 voltage is expected to be set by the bootloader and the right
voltage depends on the DRAM settings (higher clock speed needs more
voltage). Allowing to use the 'dcdc3_vol' parameter from the FEX file
only introduces an unnecessary fragile dependency between the settings
in u-boot and the settings in FEX. So now we ignore this parameter in
FEX and keep the original dcdc3 voltage set by the bootloader.

The dmesg log now looks like this:

[    2.212941] axp20_ldo1: 1300 mV
[    2.221370] axp20_ldo2: 1800 <--> 3300 mV at 3000 mV
[    2.231662] axp20_ldo3: 700 <--> 3500 mV at 2800 mV
[    2.241747] axp20_ldo4: 1250 <--> 3300 mV at 2800 mV
[    2.251906] axp20_buck2: 700 <--> 2275 mV at 1400 mV
[    2.263430] somebody is trying to set dcdc3 range to (1300000, 1300000) uV
[    2.275327] but we keep dcdc3 = 1250000 uV from the bootloader
[    2.285406] axp20_buck3: 700 <--> 3500 mV at 1250 mV
[    2.295299] axp20_ldoio0: 1800 <--> 3300 mV at 2800 mV

Signed-off-by: Siarhei Siamashka <siarhei.siamas...@gmail.com>
---
 drivers/power/axp_power/axp20-regu.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/power/axp_power/axp20-regu.c 
b/drivers/power/axp_power/axp20-regu.c
index e56c5f5..30ceb5c 100644
--- a/drivers/power/axp_power/axp20-regu.c
+++ b/drivers/power/axp_power/axp20-regu.c
@@ -37,6 +37,7 @@ static inline int check_range(struct axp_regulator_info *info,
        return 0;
 }
 
+static int axp_get_voltage(struct regulator_dev *rdev);
 
 /* AXP common operations */
 static int axp_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
@@ -45,7 +46,14 @@ static int axp_set_voltage(struct regulator_dev *rdev, int 
min_uV, int max_uV,
        struct axp_regulator_info *info = rdev_get_drvdata(rdev);
        struct device *axp_dev = to_axp_dev(rdev);
        uint8_t val, mask;
-       
+
+       if (rdev_get_id(rdev) == AXP20_ID_BUCK3) {
+               pr_err("somebody is trying to set dcdc3 range to (%d, %d) uV\n",
+                       min_uV, max_uV);
+               pr_err("but we keep dcdc3 = %d uV from the bootloader\n",
+                       axp_get_voltage(rdev));
+               return 0;
+       }
 
        if (check_range(info, min_uV, max_uV)) {
                pr_err("invalid voltage range (%d, %d) uV\n", min_uV, max_uV);
-- 
1.8.3.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to