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

Commit ff753edc authored by David Collins's avatar David Collins
Browse files

regulator: Call proxy-consumer functions for each regulator registered



Add a call to regulator_proxy_consumer_register() at the end of
regulator_register() and a call to
regulator_proxy_consumer_unregister() at the beginning of
regulator_unregister().  These calls ensure that proxy consumer
features may be used by any type of regulator regardless of the
driver supporting it.

Change-Id: Ia70da1df47042fa673c42f389136557f868d19a3
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent cf03466c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4755,6 +4755,8 @@ regulator_register(const struct regulator_desc *regulator_desc,

	dev_set_drvdata(&rdev->dev, rdev);
	rdev_init_debugfs(rdev);
	rdev->proxy_consumer = regulator_proxy_consumer_register(dev,
							config->of_node);

	/* try to resolve regulators supply since a new one was registered */
	class_for_each_device(&regulator_class, NULL, NULL,
@@ -4794,6 +4796,7 @@ void regulator_unregister(struct regulator_dev *rdev)
			regulator_disable(rdev->supply);
		regulator_put(rdev->supply);
	}
	regulator_proxy_consumer_unregister(rdev->proxy_consumer);
	rdev_deinit_debugfs(rdev);
	mutex_lock(&regulator_list_mutex);
	flush_work(&rdev->disable_work.work);
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/device.h>
#include <linux/notifier.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/proxy-consumer.h>

struct gpio_desc;
struct regmap;
@@ -476,6 +477,7 @@ struct regulator_dev {

	/* time when this regulator was disabled last time */
	unsigned long last_off_jiffy;
	struct proxy_consumer *proxy_consumer;
	struct regulator *debug_consumer;
};