Commit 6fb28bad authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarMagnus Damm <damm@opensource.se>
parent bed2b42d
...@@ -436,7 +436,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd) ...@@ -436,7 +436,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
not_suspended = 0; not_suspended = 0;
list_for_each_entry(pdd, &genpd->dev_list, list_node) list_for_each_entry(pdd, &genpd->dev_list, list_node)
if (pdd->dev->driver && (!pm_runtime_suspended(pdd->dev) if (pdd->dev->driver && (!pm_runtime_suspended(pdd->dev)
|| pdd->dev->power.irq_safe || to_gpd_data(pdd)->always_on)) || pdd->dev->power.irq_safe || to_gpd_data(pdd)->syscore))
not_suspended++; not_suspended++;
if (not_suspended > genpd->in_progress) if (not_suspended > genpd->in_progress)
...@@ -578,7 +578,7 @@ static int pm_genpd_runtime_suspend(struct device *dev) ...@@ -578,7 +578,7 @@ static int pm_genpd_runtime_suspend(struct device *dev)
might_sleep_if(!genpd->dev_irq_safe); might_sleep_if(!genpd->dev_irq_safe);
if (dev_gpd_data(dev)->always_on) if (dev_gpd_data(dev)->syscore)
return -EBUSY; return -EBUSY;
stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL; stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL;
...@@ -983,7 +983,7 @@ static int pm_genpd_suspend_noirq(struct device *dev) ...@@ -983,7 +983,7 @@ static int pm_genpd_suspend_noirq(struct device *dev)
if (IS_ERR(genpd)) if (IS_ERR(genpd))
return -EINVAL; return -EINVAL;
if (genpd->suspend_power_off || dev_gpd_data(dev)->always_on if (genpd->suspend_power_off || dev_gpd_data(dev)->syscore
|| (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))) || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
return 0; return 0;
...@@ -1016,7 +1016,7 @@ static int pm_genpd_resume_noirq(struct device *dev) ...@@ -1016,7 +1016,7 @@ static int pm_genpd_resume_noirq(struct device *dev)
if (IS_ERR(genpd)) if (IS_ERR(genpd))
return -EINVAL; return -EINVAL;
if (genpd->suspend_power_off || dev_gpd_data(dev)->always_on if (genpd->suspend_power_off || dev_gpd_data(dev)->syscore
|| (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))) || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
return 0; return 0;
...@@ -1136,7 +1136,7 @@ static int pm_genpd_freeze_noirq(struct device *dev) ...@@ -1136,7 +1136,7 @@ static int pm_genpd_freeze_noirq(struct device *dev)
if (IS_ERR(genpd)) if (IS_ERR(genpd))
return -EINVAL; return -EINVAL;
return genpd->suspend_power_off || dev_gpd_data(dev)->always_on ? return genpd->suspend_power_off || dev_gpd_data(dev)->syscore ?
0 : genpd_stop_dev(genpd, dev); 0 : genpd_stop_dev(genpd, dev);
} }
...@@ -1157,7 +1157,7 @@ static int pm_genpd_thaw_noirq(struct device *dev) ...@@ -1157,7 +1157,7 @@ static int pm_genpd_thaw_noirq(struct device *dev)
if (IS_ERR(genpd)) if (IS_ERR(genpd))
return -EINVAL; return -EINVAL;
return genpd->suspend_power_off || dev_gpd_data(dev)->always_on ? return genpd->suspend_power_off || dev_gpd_data(dev)->syscore ?
0 : genpd_start_dev(genpd, dev); 0 : genpd_start_dev(genpd, dev);
} }
...@@ -1253,7 +1253,7 @@ static int pm_genpd_restore_noirq(struct device *dev) ...@@ -1253,7 +1253,7 @@ static int pm_genpd_restore_noirq(struct device *dev)
pm_genpd_sync_poweron(genpd); pm_genpd_sync_poweron(genpd);
return dev_gpd_data(dev)->always_on ? 0 : genpd_start_dev(genpd, dev); return dev_gpd_data(dev)->syscore ? 0 : genpd_start_dev(genpd, dev);
} }
/** /**
...@@ -1526,11 +1526,11 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd, ...@@ -1526,11 +1526,11 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
} }
/** /**
* pm_genpd_dev_always_on - Set/unset the "always on" flag for a given device. * pm_genpd_dev_syscore - Set/unset the "syscore" flag for a given device.
* @dev: Device to set/unset the flag for. * @dev: Device to set/unset the flag for.
* @val: The new value of the device's "always on" flag. * @val: The new value of the device's "syscore" flag.
*/ */
void pm_genpd_dev_always_on(struct device *dev, bool val) void pm_genpd_dev_syscore(struct device *dev, bool val)
{ {
struct pm_subsys_data *psd; struct pm_subsys_data *psd;
unsigned long flags; unsigned long flags;
...@@ -1539,11 +1539,11 @@ void pm_genpd_dev_always_on(struct device *dev, bool val) ...@@ -1539,11 +1539,11 @@ void pm_genpd_dev_always_on(struct device *dev, bool val)
psd = dev_to_psd(dev); psd = dev_to_psd(dev);
if (psd && psd->domain_data) if (psd && psd->domain_data)
to_gpd_data(psd->domain_data)->always_on = val; to_gpd_data(psd->domain_data)->syscore = val;
spin_unlock_irqrestore(&dev->power.lock, flags); spin_unlock_irqrestore(&dev->power.lock, flags);
} }
EXPORT_SYMBOL_GPL(pm_genpd_dev_always_on); EXPORT_SYMBOL_GPL(pm_genpd_dev_syscore);
/** /**
* pm_genpd_dev_need_restore - Set/unset the device's "need restore" flag. * pm_genpd_dev_need_restore - Set/unset the device's "need restore" flag.
......
...@@ -717,7 +717,7 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev) ...@@ -717,7 +717,7 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
struct sh_timer_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
if (cfg->clocksource_rating || cfg->clockevent_rating) if (cfg->clocksource_rating || cfg->clockevent_rating)
pm_genpd_dev_always_on(&pdev->dev, true); pm_genpd_dev_syscore(&pdev->dev, true);
} }
if (p) { if (p) {
......
...@@ -323,7 +323,7 @@ static int __devinit sh_mtu2_probe(struct platform_device *pdev) ...@@ -323,7 +323,7 @@ static int __devinit sh_mtu2_probe(struct platform_device *pdev)
struct sh_timer_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
if (cfg->clockevent_rating) if (cfg->clockevent_rating)
pm_genpd_dev_always_on(&pdev->dev, true); pm_genpd_dev_syscore(&pdev->dev, true);
} }
if (p) { if (p) {
......
...@@ -453,7 +453,7 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev) ...@@ -453,7 +453,7 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
struct sh_timer_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
if (cfg->clocksource_rating || cfg->clockevent_rating) if (cfg->clocksource_rating || cfg->clockevent_rating)
pm_genpd_dev_always_on(&pdev->dev, true); pm_genpd_dev_syscore(&pdev->dev, true);
} }
if (p) { if (p) {
......
...@@ -114,7 +114,7 @@ struct generic_pm_domain_data { ...@@ -114,7 +114,7 @@ struct generic_pm_domain_data {
struct mutex lock; struct mutex lock;
unsigned int refcount; unsigned int refcount;
bool need_restore; bool need_restore;
bool always_on; bool syscore;
}; };
#ifdef CONFIG_PM_GENERIC_DOMAINS #ifdef CONFIG_PM_GENERIC_DOMAINS
...@@ -153,7 +153,7 @@ static inline int pm_genpd_of_add_device(struct device_node *genpd_node, ...@@ -153,7 +153,7 @@ static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
struct device *dev); struct device *dev);
extern void pm_genpd_dev_always_on(struct device *dev, bool val); extern void pm_genpd_dev_syscore(struct device *dev, bool val);
extern void pm_genpd_dev_need_restore(struct device *dev, bool val); extern void pm_genpd_dev_need_restore(struct device *dev, bool val);
extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
struct generic_pm_domain *new_subdomain); struct generic_pm_domain *new_subdomain);
...@@ -199,7 +199,7 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, ...@@ -199,7 +199,7 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
{ {
return -ENOSYS; return -ENOSYS;
} }
static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {} static inline void pm_genpd_dev_syscore(struct device *dev, bool val) {}
static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {}
static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
struct generic_pm_domain *new_sd) struct generic_pm_domain *new_sd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment