aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-05-18 14:46:17 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-18 14:46:17 -0400
commit06132ee903e3b0fe3541970e017762a3df3e0551 (patch)
tree11ed07b6df259fa42797b723600fc70da10c4503 /drivers/base
parent351520a9ebfdf2f36cd97c1192f280e0ac7fdcfc (diff)
parentca1d72f033d4a89e60db25f680896c76c721062b (diff)
Merge branch 'pm-domains'
* pm-domains: PM / Domains: Make it possible to add devices to inactive domains
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index c3eaa08a8f96..83aa694a8efe 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1263,11 +1263,6 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
1263 1263
1264 genpd_acquire_lock(genpd); 1264 genpd_acquire_lock(genpd);
1265 1265
1266 if (genpd->status == GPD_STATE_POWER_OFF) {
1267 ret = -EINVAL;
1268 goto out;
1269 }
1270
1271 if (genpd->prepared_count > 0) { 1266 if (genpd->prepared_count > 0) {
1272 ret = -EAGAIN; 1267 ret = -EAGAIN;
1273 goto out; 1268 goto out;
@@ -1290,7 +1285,7 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
1290 dev->power.subsys_data->domain_data = &gpd_data->base; 1285 dev->power.subsys_data->domain_data = &gpd_data->base;
1291 gpd_data->base.dev = dev; 1286 gpd_data->base.dev = dev;
1292 list_add_tail(&gpd_data->base.list_node, &genpd->dev_list); 1287 list_add_tail(&gpd_data->base.list_node, &genpd->dev_list);
1293 gpd_data->need_restore = false; 1288 gpd_data->need_restore = genpd->status == GPD_STATE_POWER_OFF;
1294 if (td) 1289 if (td)
1295 gpd_data->td = *td; 1290 gpd_data->td = *td;
1296 1291
@@ -1418,6 +1413,26 @@ void pm_genpd_dev_always_on(struct device *dev, bool val)
1418EXPORT_SYMBOL_GPL(pm_genpd_dev_always_on); 1413EXPORT_SYMBOL_GPL(pm_genpd_dev_always_on);
1419 1414
1420/** 1415/**
1416 * pm_genpd_dev_need_restore - Set/unset the device's "need restore" flag.
1417 * @dev: Device to set/unset the flag for.
1418 * @val: The new value of the device's "need restore" flag.
1419 */
1420void pm_genpd_dev_need_restore(struct device *dev, bool val)
1421{
1422 struct pm_subsys_data *psd;
1423 unsigned long flags;
1424
1425 spin_lock_irqsave(&dev->power.lock, flags);
1426
1427 psd = dev_to_psd(dev);
1428 if (psd && psd->domain_data)
1429 to_gpd_data(psd->domain_data)->need_restore = val;
1430
1431 spin_unlock_irqrestore(&dev->power.lock, flags);
1432}
1433EXPORT_SYMBOL_GPL(pm_genpd_dev_need_restore);
1434
1435/**
1421 * pm_genpd_add_subdomain - Add a subdomain to an I/O PM domain. 1436 * pm_genpd_add_subdomain - Add a subdomain to an I/O PM domain.
1422 * @genpd: Master PM domain to add the subdomain to. 1437 * @genpd: Master PM domain to add the subdomain to.
1423 * @subdomain: Subdomain to be added. 1438 * @subdomain: Subdomain to be added.