diff options
author | Mark Brown <broonie@linaro.org> | 2013-07-15 18:31:04 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-15 18:31:04 +0100 |
commit | 92d8ecae7eda0820663933e568915dbf7ef79127 (patch) | |
tree | f602547b7f5aa63ef9fadbd791ad06810fdb9db8 /drivers/regulator | |
parent | 1e1598ed04d831f5bb42a197b4045e6780365217 (diff) | |
parent | 5b175952011adae30b531ab89cc24acb173b2ce4 (diff) | |
download | op-kernel-dev-92d8ecae7eda0820663933e568915dbf7ef79127.zip op-kernel-dev-92d8ecae7eda0820663933e568915dbf7ef79127.tar.gz |
Merge branch 'topic/ramp' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-sec
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 7 | ||||
-rw-r--r-- | drivers/regulator/of_regulator.c | 12 |
2 files changed, 13 insertions, 6 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 288c75a..15368f3 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -984,7 +984,8 @@ static int set_machine_constraints(struct regulator_dev *rdev, } } - if (rdev->constraints->ramp_delay && ops->set_ramp_delay) { + if ((rdev->constraints->ramp_delay || rdev->constraints->ramp_disable) + && ops->set_ramp_delay) { ret = ops->set_ramp_delay(rdev, rdev->constraints->ramp_delay); if (ret < 0) { rdev_err(rdev, "failed to set ramp_delay\n"); @@ -2438,8 +2439,8 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, } /* Call set_voltage_time_sel if successfully obtained old_selector */ - if (ret == 0 && _regulator_is_enabled(rdev) && old_selector >= 0 && - old_selector != selector && rdev->desc->ops->set_voltage_time_sel) { + if (ret == 0 && !rdev->constraints->ramp_disable && old_selector >= 0 + && old_selector != selector) { delay = rdev->desc->ops->set_voltage_time_sel(rdev, old_selector, selector); diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index f3c8f8f..7827384 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -21,6 +21,7 @@ static void of_get_regulation_constraints(struct device_node *np, { const __be32 *min_uV, *max_uV, *uV_offset; const __be32 *min_uA, *max_uA, *ramp_delay; + struct property *prop; struct regulation_constraints *constraints = &(*init_data)->constraints; constraints->name = of_get_property(np, "regulator-name", NULL); @@ -64,9 +65,14 @@ static void of_get_regulation_constraints(struct device_node *np, if (of_property_read_bool(np, "regulator-allow-bypass")) constraints->valid_ops_mask |= REGULATOR_CHANGE_BYPASS; - ramp_delay = of_get_property(np, "regulator-ramp-delay", NULL); - if (ramp_delay) - constraints->ramp_delay = be32_to_cpu(*ramp_delay); + prop = of_find_property(np, "regulator-ramp-delay", NULL); + if (prop && prop->value) { + ramp_delay = prop->value; + if (*ramp_delay) + constraints->ramp_delay = be32_to_cpu(*ramp_delay); + else + constraints->ramp_disable = true; + } } /** |