ANDROID: GKI: 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.

Bug: 150508586
Change-Id: Ia70da1df47042fa673c42f389136557f868d19a3
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit ff753edc6d60e1e1043931409e6d3ac6e01b8108)
[Fixed minor conflicts from dropping an earlier debugfs patch]
Signed-off-by: Saravana Kannan <saravanak@google.com>
This commit is contained in:
David Collins
2013-07-08 14:33:22 -07:00
committed by Saravana Kannan
parent 653a867e09
commit 4bad67ba2a
2 changed files with 5 additions and 0 deletions

View File

@@ -4436,6 +4436,8 @@ regulator_register(const struct regulator_desc *regulator_desc,
}
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,
@@ -4475,6 +4477,7 @@ void regulator_unregister(struct regulator_dev *rdev)
regulator_disable(rdev->supply);
regulator_put(rdev->supply);
}
regulator_proxy_consumer_unregister(rdev->proxy_consumer);
mutex_lock(&regulator_list_mutex);
debugfs_remove_recursive(rdev->debugfs);
flush_work(&rdev->disable_work.work);

View File

@@ -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;
@@ -475,6 +476,7 @@ struct regulator_dev {
/* time when this regulator was disabled last time */
unsigned long last_off_jiffy;
struct proxy_consumer *proxy_consumer;
};
struct regulator_dev *