diff options
| author | David Collins <collinsd@codeaurora.org> | 2013-07-08 14:33:22 -0700 |
|---|---|---|
| committer | Rohit Vaswani <rvaswani@codeaurora.org> | 2016-03-01 12:22:36 -0800 |
| commit | 9a5aec1c9268ffe4c857c5298bf43a0ddb9553d7 (patch) | |
| tree | 0592f85e04f3d9d03886b8c7c14aa3469cc8f840 | |
| parent | 32c846e998a15394b04ee7512cbb90014174e68d (diff) | |
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: David Collins <collinsd@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
[adharmap: resolve trivial merge conflicts]
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
| -rw-r--r-- | drivers/regulator/core.c | 3 | ||||
| -rw-r--r-- | include/linux/regulator/driver.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 78a3a1e282a0..bcc81c0d94fd 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4381,6 +4381,8 @@ regulator_register(const struct regulator_desc *regulator_desc, mutex_unlock(®ulator_list_mutex); rdev_init_debugfs(rdev); + rdev->proxy_consumer = regulator_proxy_consumer_register(dev, + config->of_node); kfree(config); return rdev; @@ -4424,6 +4426,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(®ulator_list_mutex); debugfs_remove_recursive(rdev->debugfs); flush_work(&rdev->disable_work.work); diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 9c2903e58adb..143598e3bd7e 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -18,6 +18,7 @@ #include <linux/device.h> #include <linux/notifier.h> #include <linux/regulator/consumer.h> +#include <linux/regulator/proxy-consumer.h> struct regmap; struct regulator_dev; @@ -399,6 +400,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 * |
