summaryrefslogtreecommitdiff
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-08-06 01:46:39 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2012-09-04 01:36:04 +0200
commitdbf374142dd7a3c394ec124ebe7339a6c412d9b6 (patch)
tree593b26dff2da2f364ed1ad97e667d691487d7e69 /include/linux/pm.h
parent6fb28badf207a6d8a78906353772e1c3f560a977 (diff)
downloadlwn-dbf374142dd7a3c394ec124ebe7339a6c412d9b6.tar.gz
lwn-dbf374142dd7a3c394ec124ebe7339a6c412d9b6.zip
PM / Domains: Move syscore flag from subsys data to struct device
The syscore device PM 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. That flag is stored in the device's struct pm_subsys_data object whose address is available from struct device. However, in some situations it may be convenient to set that flag before the device is added to a PM domain, so it is better to move it directly to the "power" member of struct device. Then, it can be checked by the routines in drivers/base/power/runtime.c and drivers/base/power/main.c, which is more straightforward. This also reduces the number of dev_gpd_data() invocations in the generic PM domains framework, so the overhead related to the syscore flag is slightly smaller. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Magnus Damm <damm@opensource.se>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 716517af1543..b79a0dd3bc6d 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -43,8 +43,12 @@ struct device;
#ifdef CONFIG_PM
extern const char power_group_name[]; /* = "power" */
+
+extern void dev_pm_syscore_device(struct device *dev, bool val);
#else
#define power_group_name NULL
+
+static inline void dev_pm_syscore_device(struct device *dev, bool val) {}
#endif
typedef struct pm_message {
@@ -511,6 +515,7 @@ struct dev_pm_info {
bool is_suspended:1; /* Ditto */
bool ignore_children:1;
bool early_init:1; /* Owned by the PM core */
+ bool syscore:1;
spinlock_t lock;
#ifdef CONFIG_PM_SLEEP
struct list_head entry;