diff options
Diffstat (limited to 'include/linux/pm_domain.h')
-rw-r--r-- | include/linux/pm_domain.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index f9ec1736a116..65633e5a2bc0 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | enum gpd_status { | 14 | enum gpd_status { |
15 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ | 15 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ |
16 | GPD_STATE_WAIT_MASTER, /* PM domain's master is being waited for */ | ||
16 | GPD_STATE_BUSY, /* Something is happening to the PM domain */ | 17 | GPD_STATE_BUSY, /* Something is happening to the PM domain */ |
17 | GPD_STATE_REPEAT, /* Power off in progress, to be repeated */ | 18 | GPD_STATE_REPEAT, /* Power off in progress, to be repeated */ |
18 | GPD_STATE_POWER_OFF, /* PM domain is off */ | 19 | GPD_STATE_POWER_OFF, /* PM domain is off */ |
@@ -25,15 +26,14 @@ struct dev_power_governor { | |||
25 | struct generic_pm_domain { | 26 | struct generic_pm_domain { |
26 | struct dev_pm_domain domain; /* PM domain operations */ | 27 | struct dev_pm_domain domain; /* PM domain operations */ |
27 | struct list_head gpd_list_node; /* Node in the global PM domains list */ | 28 | struct list_head gpd_list_node; /* Node in the global PM domains list */ |
28 | struct list_head sd_node; /* Node in the parent's subdomain list */ | 29 | struct list_head master_links; /* Links with PM domain as a master */ |
29 | struct generic_pm_domain *parent; /* Parent PM domain */ | 30 | struct list_head slave_links; /* Links with PM domain as a slave */ |
30 | struct list_head sd_list; /* List of dubdomains */ | ||
31 | struct list_head dev_list; /* List of devices */ | 31 | struct list_head dev_list; /* List of devices */ |
32 | struct mutex lock; | 32 | struct mutex lock; |
33 | struct dev_power_governor *gov; | 33 | struct dev_power_governor *gov; |
34 | struct work_struct power_off_work; | 34 | struct work_struct power_off_work; |
35 | unsigned int in_progress; /* Number of devices being suspended now */ | 35 | unsigned int in_progress; /* Number of devices being suspended now */ |
36 | unsigned int sd_count; /* Number of subdomains with power "on" */ | 36 | atomic_t sd_count; /* Number of subdomains with power "on" */ |
37 | enum gpd_status status; /* Current state of the domain */ | 37 | enum gpd_status status; /* Current state of the domain */ |
38 | wait_queue_head_t status_wait_queue; | 38 | wait_queue_head_t status_wait_queue; |
39 | struct task_struct *poweroff_task; /* Powering off task */ | 39 | struct task_struct *poweroff_task; /* Powering off task */ |
@@ -42,6 +42,7 @@ struct generic_pm_domain { | |||
42 | unsigned int suspended_count; /* System suspend device counter */ | 42 | unsigned int suspended_count; /* System suspend device counter */ |
43 | unsigned int prepared_count; /* Suspend counter of prepared devices */ | 43 | unsigned int prepared_count; /* Suspend counter of prepared devices */ |
44 | bool suspend_power_off; /* Power status before system suspend */ | 44 | bool suspend_power_off; /* Power status before system suspend */ |
45 | bool dev_irq_safe; /* Device callbacks are IRQ-safe */ | ||
45 | int (*power_off)(struct generic_pm_domain *domain); | 46 | int (*power_off)(struct generic_pm_domain *domain); |
46 | int (*power_on)(struct generic_pm_domain *domain); | 47 | int (*power_on)(struct generic_pm_domain *domain); |
47 | int (*start_device)(struct device *dev); | 48 | int (*start_device)(struct device *dev); |
@@ -54,12 +55,23 @@ static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) | |||
54 | return container_of(pd, struct generic_pm_domain, domain); | 55 | return container_of(pd, struct generic_pm_domain, domain); |
55 | } | 56 | } |
56 | 57 | ||
57 | struct dev_list_entry { | 58 | struct gpd_link { |
58 | struct list_head node; | 59 | struct generic_pm_domain *master; |
59 | struct device *dev; | 60 | struct list_head master_node; |
61 | struct generic_pm_domain *slave; | ||
62 | struct list_head slave_node; | ||
63 | }; | ||
64 | |||
65 | struct generic_pm_domain_data { | ||
66 | struct pm_domain_data base; | ||
60 | bool need_restore; | 67 | bool need_restore; |
61 | }; | 68 | }; |
62 | 69 | ||
70 | static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *pdd) | ||
71 | { | ||
72 | return container_of(pdd, struct generic_pm_domain_data, base); | ||
73 | } | ||
74 | |||
63 | #ifdef CONFIG_PM_GENERIC_DOMAINS | 75 | #ifdef CONFIG_PM_GENERIC_DOMAINS |
64 | extern int pm_genpd_add_device(struct generic_pm_domain *genpd, | 76 | extern int pm_genpd_add_device(struct generic_pm_domain *genpd, |
65 | struct device *dev); | 77 | struct device *dev); |