summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@freescale.com>2014-06-16 14:11:51 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 08:57:39 -0500
commit38136936bfa3a283f6118b45d55628b9c11adc2a (patch)
tree238822c3a5deef0ce29c5f82c14ba4cb9d9b77a1 /drivers/regulator
parent1f1def239369bcd902a16a8ccbec285ec4aa0071 (diff)
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>
Diffstat (limited to 'drivers/regulator')
-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 7c397bb81e01..0beba86f895b 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -55,6 +55,9 @@ struct anatop_regulator {
int sel;
};
+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)
@@ -86,6 +89,13 @@ static int anatop_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);
}
@@ -200,6 +210,11 @@ static int anatop_regulator_probe(struct platform_device *pdev)
rdesc->type = REGULATOR_VOLTAGE;
rdesc->owner = THIS_MODULE;
+ 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;