aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm_domain.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pm_domain.h')
-rw-r--r--include/linux/pm_domain.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index b1a22c65380..7961b0dac43 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -11,6 +11,9 @@
11 11
12#include <linux/device.h> 12#include <linux/device.h>
13 13
14#define GPD_IN_SUSPEND 1
15#define GPD_POWER_OFF 2
16
14struct dev_power_governor { 17struct dev_power_governor {
15 bool (*power_down_ok)(struct dev_pm_domain *domain); 18 bool (*power_down_ok)(struct dev_pm_domain *domain);
16}; 19};
@@ -27,12 +30,21 @@ struct generic_pm_domain {
27 unsigned int in_progress; /* Number of devices being suspended now */ 30 unsigned int in_progress; /* Number of devices being suspended now */
28 unsigned int sd_count; /* Number of subdomains with power "on" */ 31 unsigned int sd_count; /* Number of subdomains with power "on" */
29 bool power_is_off; /* Whether or not power has been removed */ 32 bool power_is_off; /* Whether or not power has been removed */
33 unsigned int device_count; /* Number of devices */
34 unsigned int suspended_count; /* System suspend device counter */
35 unsigned int prepared_count; /* Suspend counter of prepared devices */
36 bool suspend_power_off; /* Power status before system suspend */
30 int (*power_off)(struct generic_pm_domain *domain); 37 int (*power_off)(struct generic_pm_domain *domain);
31 int (*power_on)(struct generic_pm_domain *domain); 38 int (*power_on)(struct generic_pm_domain *domain);
32 int (*start_device)(struct device *dev); 39 int (*start_device)(struct device *dev);
33 int (*stop_device)(struct device *dev); 40 int (*stop_device)(struct device *dev);
34}; 41};
35 42
43static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
44{
45 return container_of(pd, struct generic_pm_domain, domain);
46}
47
36struct dev_list_entry { 48struct dev_list_entry {
37 struct list_head node; 49 struct list_head node;
38 struct device *dev; 50 struct device *dev;