aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorPhilip Rakity <prakity@marvell.com>2012-06-15 14:27:36 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-17 14:12:44 -0400
commit2f7baf89d3e4ed787989168cf31f2fdc04067586 (patch)
tree1450c3b321f972a2d66f2d6e5d86df415c7b6cc8 /drivers/regulator/core.c
parentd8493d210b69b2965236a8a02f5f6e2835ad5e30 (diff)
regulator: core.c Pass voltage to notifier when setting voltage
The voltage being set should be passed to the call in handler requesting the callback. Currently this is not done. The calling handler cannot call regulator_get_voltage() to get the information since the mutex is held by the regulator and deadlock occurs. Without this change the receiver of the call in cannot know what action to take. This is used, for example, to set PAD voltages when doing SD vccq voltage changes. [Review and spelling fix in the commit log from Pankaj Jangra] Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 52a9bae10393..ebdd9e0e14d4 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2142,7 +2142,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
2142 if (rdev->desc->ops->list_voltage) 2142 if (rdev->desc->ops->list_voltage)
2143 best_val = rdev->desc->ops->list_voltage(rdev, selector); 2143 best_val = rdev->desc->ops->list_voltage(rdev, selector);
2144 else 2144 else
2145 best_val = -1; 2145 best_val = _regulator_get_voltage(rdev);
2146 2146
2147 /* Call set_voltage_time_sel if successfully obtained old_selector */ 2147 /* Call set_voltage_time_sel if successfully obtained old_selector */
2148 if (_regulator_is_enabled(rdev) && ret == 0 && old_selector >= 0 && 2148 if (_regulator_is_enabled(rdev) && ret == 0 && old_selector >= 0 &&
@@ -2165,9 +2165,9 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
2165 udelay(delay); 2165 udelay(delay);
2166 } 2166 }
2167 2167
2168 if (ret == 0) 2168 if (ret == 0 && best_val >= 0)
2169 _notifier_call_chain(rdev, REGULATOR_EVENT_VOLTAGE_CHANGE, 2169 _notifier_call_chain(rdev, REGULATOR_EVENT_VOLTAGE_CHANGE,
2170 NULL); 2170 (void *)best_val);
2171 2171
2172 trace_regulator_set_voltage_complete(rdev_get_name(rdev), best_val); 2172 trace_regulator_set_voltage_complete(rdev_get_name(rdev), best_val);
2173 2173