summaryrefslogtreecommitdiff
path: root/drivers/regulator/anatop-regulator.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@freescale.com>2014-06-16 14:11:51 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:20:42 +0300
commit39a983b5d56c00795e9608d427d50d2243f4d460 (patch)
tree299b7aa1be1f55d399b2c4e99dd06706dd324df7 /drivers/regulator/anatop-regulator.c
parentd4bcc4ff79a82e84b089005735753dcdfa979f5f (diff)
MLK-11407-3: regulator: anatop: force vddpu to use same voltage level as vddsoc
This patch cherry-pick from below: "ENGR00317981: regulator: anatop: force vddpu to use same voltage level as vddsoc" The anatop on i.MX6 requires that vddpu use the same voltage level as vddsoc. It's a quick hacking to force the check whenever vddpu is about to be enabled. Signed-off-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Robin Gong <b38343@freescale.com> (cherry picked from commit ab0c52e019cacc89aec3dbb104360b4715d49796) Conflicts: drivers/regulator/anatop-regulator.c
Diffstat (limited to 'drivers/regulator/anatop-regulator.c')
-rw-r--r--drivers/regulator/anatop-regulator.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index bbd08e347f04..0a9ee4c67d2f 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -57,6 +57,9 @@ struct anatop_regulator {
u32 enable_bit;
};
+static struct anatop_regulator *vddpu;
+static struct anatop_regulator *vddsoc;
+
static int anatop_regmap_set_voltage_time_sel(struct regulator_dev *reg,
unsigned int old_sel,
unsigned int new_sel)
@@ -88,6 +91,13 @@ static int anatop_core_regmap_enable(struct regulator_dev *reg)
struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
int sel;
+ /*
+ * The vddpu has to stay at the same voltage level as vddsoc
+ * whenever it's about to be enabled.
+ */
+ if (anatop_reg == vddpu && vddsoc)
+ anatop_reg->sel = vddsoc->sel;
+
sel = anatop_reg->bypass ? LDO_FET_FULL_ON : anatop_reg->sel;
return regulator_set_voltage_sel_regmap(reg, sel);
}
@@ -241,6 +251,11 @@ static int anatop_regulator_probe(struct platform_device *pdev)
initdata->supply_regulator = "vin";
sreg->initdata = initdata;
+ if (strcmp(sreg->name, "vddpu") == 0)
+ vddpu = sreg;
+ else if (strcmp(sreg->name, "vddsoc") == 0)
+ vddsoc = sreg;
+
anatop_np = of_get_parent(np);
if (!anatop_np)
return -ENODEV;