diff options
author | Mark Brown <broonie@linaro.org> | 2013-09-01 08:50:20 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-01 08:50:20 -0400 |
commit | a89f5c759857b1d1a56a4d530ad30bc1cacc58c9 (patch) | |
tree | 8bf3973a36ad031894db5ee68866dcd6916c0bc3 /drivers/regulator | |
parent | 09f2dd88ff93a6d31e10dd5c25e2aa2a8b7b12ee (diff) | |
parent | 5b175952011adae30b531ab89cc24acb173b2ce4 (diff) |
Merge remote-tracking branch 'regulator/topic/ramp' into regulator-next
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 9f4ccf2b3340..a01b8b3b70ca 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -988,7 +988,8 @@ static int set_machine_constraints(struct regulator_dev *rdev, | |||
988 | } | 988 | } |
989 | } | 989 | } |
990 | 990 | ||
991 | if (rdev->constraints->ramp_delay && ops->set_ramp_delay) { | 991 | if ((rdev->constraints->ramp_delay || rdev->constraints->ramp_disable) |
992 | && ops->set_ramp_delay) { | ||
992 | ret = ops->set_ramp_delay(rdev, rdev->constraints->ramp_delay); | 993 | ret = ops->set_ramp_delay(rdev, rdev->constraints->ramp_delay); |
993 | if (ret < 0) { | 994 | if (ret < 0) { |
994 | rdev_err(rdev, "failed to set ramp_delay\n"); | 995 | rdev_err(rdev, "failed to set ramp_delay\n"); |
@@ -2241,8 +2242,8 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, | |||
2241 | } | 2242 | } |
2242 | 2243 | ||
2243 | /* Call set_voltage_time_sel if successfully obtained old_selector */ | 2244 | /* Call set_voltage_time_sel if successfully obtained old_selector */ |
2244 | if (ret == 0 && _regulator_is_enabled(rdev) && old_selector >= 0 && | 2245 | if (ret == 0 && !rdev->constraints->ramp_disable && old_selector >= 0 |
2245 | old_selector != selector && rdev->desc->ops->set_voltage_time_sel) { | 2246 | && old_selector != selector) { |
2246 | 2247 | ||
2247 | delay = rdev->desc->ops->set_voltage_time_sel(rdev, | 2248 | delay = rdev->desc->ops->set_voltage_time_sel(rdev, |
2248 | old_selector, selector); | 2249 | old_selector, selector); |
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index f3c8f8f9dc39..7827384680d6 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, | |||
21 | { | 21 | { |
22 | const __be32 *min_uV, *max_uV, *uV_offset; | 22 | const __be32 *min_uV, *max_uV, *uV_offset; |
23 | const __be32 *min_uA, *max_uA, *ramp_delay; | 23 | const __be32 *min_uA, *max_uA, *ramp_delay; |
24 | struct property *prop; | ||
24 | struct regulation_constraints *constraints = &(*init_data)->constraints; | 25 | struct regulation_constraints *constraints = &(*init_data)->constraints; |
25 | 26 | ||
26 | constraints->name = of_get_property(np, "regulator-name", NULL); | 27 | constraints->name = of_get_property(np, "regulator-name", NULL); |
@@ -64,9 +65,14 @@ static void of_get_regulation_constraints(struct device_node *np, | |||
64 | if (of_property_read_bool(np, "regulator-allow-bypass")) | 65 | if (of_property_read_bool(np, "regulator-allow-bypass")) |
65 | constraints->valid_ops_mask |= REGULATOR_CHANGE_BYPASS; | 66 | constraints->valid_ops_mask |= REGULATOR_CHANGE_BYPASS; |
66 | 67 | ||
67 | ramp_delay = of_get_property(np, "regulator-ramp-delay", NULL); | 68 | prop = of_find_property(np, "regulator-ramp-delay", NULL); |
68 | if (ramp_delay) | 69 | if (prop && prop->value) { |
69 | constraints->ramp_delay = be32_to_cpu(*ramp_delay); | 70 | ramp_delay = prop->value; |
71 | if (*ramp_delay) | ||
72 | constraints->ramp_delay = be32_to_cpu(*ramp_delay); | ||
73 | else | ||
74 | constraints->ramp_disable = true; | ||
75 | } | ||
70 | } | 76 | } |
71 | 77 | ||
72 | /** | 78 | /** |