Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f7baf89 authored by Philip Rakity's avatar Philip Rakity Committed by Mark Brown
Browse files

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: default avatarPhilip Rakity <prakity@marvell.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent d8493d21
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -2142,7 +2142,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
	if (rdev->desc->ops->list_voltage)
	if (rdev->desc->ops->list_voltage)
		best_val = rdev->desc->ops->list_voltage(rdev, selector);
		best_val = rdev->desc->ops->list_voltage(rdev, selector);
	else
	else
		best_val = -1;
		best_val = _regulator_get_voltage(rdev);


	/* Call set_voltage_time_sel if successfully obtained old_selector */
	/* Call set_voltage_time_sel if successfully obtained old_selector */
	if (_regulator_is_enabled(rdev) && ret == 0 && old_selector >= 0 &&
	if (_regulator_is_enabled(rdev) && ret == 0 && old_selector >= 0 &&
@@ -2165,9 +2165,9 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
		udelay(delay);
		udelay(delay);
	}
	}


	if (ret == 0)
	if (ret == 0 && best_val >= 0)
		_notifier_call_chain(rdev, REGULATOR_EVENT_VOLTAGE_CHANGE,
		_notifier_call_chain(rdev, REGULATOR_EVENT_VOLTAGE_CHANGE,
				     NULL);
				     (void *)best_val);


	trace_regulator_set_voltage_complete(rdev_get_name(rdev), best_val);
	trace_regulator_set_voltage_complete(rdev_get_name(rdev), best_val);