aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-08-05 19:45:54 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-09-03 19:36:03 -0400
commit6fb28badf207a6d8a78906353772e1c3f560a977 (patch)
tree3cb1cdc06c263708dd40e9c490fcf8ddf921bbbd
parentbed2b42d9f0b411f384c5619870ab0fea5dd116b (diff)
PM / Domains: Rename the always_on device flag to syscore
The always_on device flag is used to mark the devices (belonging to a PM domain) that should never be turned off, except for the system core (syscore) suspend/hibernation and resume stages. Change name of that flag to "syscore" to better reflect its purpose. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
-rw-r--r--drivers/base/power/domain.c24
-rw-r--r--drivers/clocksource/sh_cmt.c2
-rw-r--r--drivers/clocksource/sh_mtu2.c2
-rw-r--r--drivers/clocksource/sh_tmu.c2
-rw-r--r--include/linux/pm_domain.h6
5 files changed, 18 insertions, 18 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 515c8ecf01ce..15234ecd7edb 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -436,7 +436,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
436 not_suspended = 0; 436 not_suspended = 0;
437 list_for_each_entry(pdd, &genpd->dev_list, list_node) 437 list_for_each_entry(pdd, &genpd->dev_list, list_node)
438 if (pdd->dev->driver && (!pm_runtime_suspended(pdd->dev) 438 if (pdd->dev->driver && (!pm_runtime_suspended(pdd->dev)
439 || pdd->dev->power.irq_safe || to_gpd_data(pdd)->always_on)) 439 || pdd->dev->power.irq_safe || to_gpd_data(pdd)->syscore))
440 not_suspended++; 440 not_suspended++;
441 441
442 if (not_suspended > genpd->in_progress) 442 if (not_suspended > genpd->in_progress)
@@ -578,7 +578,7 @@ static int pm_genpd_runtime_suspend(struct device *dev)
578 578
579 might_sleep_if(!genpd->dev_irq_safe); 579 might_sleep_if(!genpd->dev_irq_safe);
580 580
581 if (dev_gpd_data(dev)->always_on) 581 if (dev_gpd_data(dev)->syscore)
582 return -EBUSY; 582 return -EBUSY;
583 583
584 stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL; 584 stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL;
@@ -983,7 +983,7 @@ static int pm_genpd_suspend_noirq(struct device *dev)
983 if (IS_ERR(genpd)) 983 if (IS_ERR(genpd))
984 return -EINVAL; 984 return -EINVAL;
985 985
986 if (genpd->suspend_power_off || dev_gpd_data(dev)->always_on 986 if (genpd->suspend_power_off || dev_gpd_data(dev)->syscore
987 || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))) 987 || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
988 return 0; 988 return 0;
989 989
@@ -1016,7 +1016,7 @@ static int pm_genpd_resume_noirq(struct device *dev)
1016 if (IS_ERR(genpd)) 1016 if (IS_ERR(genpd))
1017 return -EINVAL; 1017 return -EINVAL;
1018 1018
1019 if (genpd->suspend_power_off || dev_gpd_data(dev)->always_on 1019 if (genpd->suspend_power_off || dev_gpd_data(dev)->syscore
1020 || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))) 1020 || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
1021 return 0; 1021 return 0;
1022 1022
@@ -1136,7 +1136,7 @@ static int pm_genpd_freeze_noirq(struct device *dev)
1136 if (IS_ERR(genpd)) 1136 if (IS_ERR(genpd))
1137 return -EINVAL; 1137 return -EINVAL;
1138 1138
1139 return genpd->suspend_power_off || dev_gpd_data(dev)->always_on ? 1139 return genpd->suspend_power_off || dev_gpd_data(dev)->syscore ?
1140 0 : genpd_stop_dev(genpd, dev); 1140 0 : genpd_stop_dev(genpd, dev);
1141} 1141}
1142 1142
@@ -1157,7 +1157,7 @@ static int pm_genpd_thaw_noirq(struct device *dev)
1157 if (IS_ERR(genpd)) 1157 if (IS_ERR(genpd))
1158 return -EINVAL; 1158 return -EINVAL;
1159 1159
1160 return genpd->suspend_power_off || dev_gpd_data(dev)->always_on ? 1160 return genpd->suspend_power_off || dev_gpd_data(dev)->syscore ?
1161 0 : genpd_start_dev(genpd, dev); 1161 0 : genpd_start_dev(genpd, dev);
1162} 1162}
1163 1163
@@ -1253,7 +1253,7 @@ static int pm_genpd_restore_noirq(struct device *dev)
1253 1253
1254 pm_genpd_sync_poweron(genpd); 1254 pm_genpd_sync_poweron(genpd);
1255 1255
1256 return dev_gpd_data(dev)->always_on ? 0 : genpd_start_dev(genpd, dev); 1256 return dev_gpd_data(dev)->syscore ? 0 : genpd_start_dev(genpd, dev);
1257} 1257}
1258 1258
1259/** 1259/**
@@ -1526,11 +1526,11 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
1526} 1526}
1527 1527
1528/** 1528/**
1529 * pm_genpd_dev_always_on - Set/unset the "always on" flag for a given device. 1529 * pm_genpd_dev_syscore - Set/unset the "syscore" flag for a given device.
1530 * @dev: Device to set/unset the flag for. 1530 * @dev: Device to set/unset the flag for.
1531 * @val: The new value of the device's "always on" flag. 1531 * @val: The new value of the device's "syscore" flag.
1532 */ 1532 */
1533void pm_genpd_dev_always_on(struct device *dev, bool val) 1533void pm_genpd_dev_syscore(struct device *dev, bool val)
1534{ 1534{
1535 struct pm_subsys_data *psd; 1535 struct pm_subsys_data *psd;
1536 unsigned long flags; 1536 unsigned long flags;
@@ -1539,11 +1539,11 @@ void pm_genpd_dev_always_on(struct device *dev, bool val)
1539 1539
1540 psd = dev_to_psd(dev); 1540 psd = dev_to_psd(dev);
1541 if (psd && psd->domain_data) 1541 if (psd && psd->domain_data)
1542 to_gpd_data(psd->domain_data)->always_on = val; 1542 to_gpd_data(psd->domain_data)->syscore = val;
1543 1543
1544 spin_unlock_irqrestore(&dev->power.lock, flags); 1544 spin_unlock_irqrestore(&dev->power.lock, flags);
1545} 1545}
1546EXPORT_SYMBOL_GPL(pm_genpd_dev_always_on); 1546EXPORT_SYMBOL_GPL(pm_genpd_dev_syscore);
1547 1547
1548/** 1548/**
1549 * pm_genpd_dev_need_restore - Set/unset the device's "need restore" flag. 1549 * pm_genpd_dev_need_restore - Set/unset the device's "need restore" flag.
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index c06d27fc59e8..c6fbb9f71911 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -717,7 +717,7 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
717 struct sh_timer_config *cfg = pdev->dev.platform_data; 717 struct sh_timer_config *cfg = pdev->dev.platform_data;
718 718
719 if (cfg->clocksource_rating || cfg->clockevent_rating) 719 if (cfg->clocksource_rating || cfg->clockevent_rating)
720 pm_genpd_dev_always_on(&pdev->dev, true); 720 pm_genpd_dev_syscore(&pdev->dev, true);
721 } 721 }
722 722
723 if (p) { 723 if (p) {
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
index a55bb905812e..278c18abb2ae 100644
--- a/drivers/clocksource/sh_mtu2.c
+++ b/drivers/clocksource/sh_mtu2.c
@@ -323,7 +323,7 @@ static int __devinit sh_mtu2_probe(struct platform_device *pdev)
323 struct sh_timer_config *cfg = pdev->dev.platform_data; 323 struct sh_timer_config *cfg = pdev->dev.platform_data;
324 324
325 if (cfg->clockevent_rating) 325 if (cfg->clockevent_rating)
326 pm_genpd_dev_always_on(&pdev->dev, true); 326 pm_genpd_dev_syscore(&pdev->dev, true);
327 } 327 }
328 328
329 if (p) { 329 if (p) {
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 7d700829bb41..5319689c579c 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -453,7 +453,7 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
453 struct sh_timer_config *cfg = pdev->dev.platform_data; 453 struct sh_timer_config *cfg = pdev->dev.platform_data;
454 454
455 if (cfg->clocksource_rating || cfg->clockevent_rating) 455 if (cfg->clocksource_rating || cfg->clockevent_rating)
456 pm_genpd_dev_always_on(&pdev->dev, true); 456 pm_genpd_dev_syscore(&pdev->dev, true);
457 } 457 }
458 458
459 if (p) { 459 if (p) {
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index ab83cf3dfaac..dab0938603fa 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -114,7 +114,7 @@ struct generic_pm_domain_data {
114 struct mutex lock; 114 struct mutex lock;
115 unsigned int refcount; 115 unsigned int refcount;
116 bool need_restore; 116 bool need_restore;
117 bool always_on; 117 bool syscore;
118}; 118};
119 119
120#ifdef CONFIG_PM_GENERIC_DOMAINS 120#ifdef CONFIG_PM_GENERIC_DOMAINS
@@ -153,7 +153,7 @@ static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
153 153
154extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, 154extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
155 struct device *dev); 155 struct device *dev);
156extern void pm_genpd_dev_always_on(struct device *dev, bool val); 156extern void pm_genpd_dev_syscore(struct device *dev, bool val);
157extern void pm_genpd_dev_need_restore(struct device *dev, bool val); 157extern void pm_genpd_dev_need_restore(struct device *dev, bool val);
158extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 158extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
159 struct generic_pm_domain *new_subdomain); 159 struct generic_pm_domain *new_subdomain);
@@ -199,7 +199,7 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
199{ 199{
200 return -ENOSYS; 200 return -ENOSYS;
201} 201}
202static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {} 202static inline void pm_genpd_dev_syscore(struct device *dev, bool val) {}
203static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} 203static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {}
204static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 204static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
205 struct generic_pm_domain *new_sd) 205 struct generic_pm_domain *new_sd)