aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-12-01 16:12:27 -0500
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-03-03 09:49:23 -0500
commit84b6826306119dc3c41ef9d7ed6c408112f63301 (patch)
treec80020268cc8b2b62524f4e9f29278332db37310 /drivers/regulator/core.c
parent6faa7e0a4bb1215fb0a0093a0d426a72599e5982 (diff)
regulator: Add notifier event on regulator disable
The intended use case is for drivers which disable regulators to save power but need to do some work to restore the hardware state when restarting. If the supplies are not actually disabled due to board limits or sharing with other active devices this notifier allows the driver to avoid unneeded reinitialisation, particularly when used with runtime PM. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index b60a4c9f8f16..6d2ce8a05331 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1341,6 +1341,9 @@ static int _regulator_disable(struct regulator_dev *rdev)
1341 __func__, rdev_get_name(rdev)); 1341 __func__, rdev_get_name(rdev));
1342 return ret; 1342 return ret;
1343 } 1343 }
1344
1345 _notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
1346 NULL);
1344 } 1347 }
1345 1348
1346 /* decrease our supplies ref count and disable if required */ 1349 /* decrease our supplies ref count and disable if required */
@@ -1399,8 +1402,8 @@ static int _regulator_force_disable(struct regulator_dev *rdev)
1399 return ret; 1402 return ret;
1400 } 1403 }
1401 /* notify other consumers that power has been forced off */ 1404 /* notify other consumers that power has been forced off */
1402 _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE, 1405 _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE |
1403 NULL); 1406 REGULATOR_EVENT_DISABLE, NULL);
1404 } 1407 }
1405 1408
1406 /* decrease our supplies ref count and disable if required */ 1409 /* decrease our supplies ref count and disable if required */