diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:03:17 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:03:17 -0400 |
commit | 7791bd230c6fe65348456564743f99fa066f00e7 (patch) | |
tree | e9ed6b3e1baea455a65274aa054ebd29d2623b92 /include | |
parent | 3db0bc97678d7de32f25514b290a0ca028dd4512 (diff) | |
parent | 8e9afafdad59f5973a5e72e05db9802f82091398 (diff) |
Merge branch 'pm-domains'
* pm-domains:
PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset
PM / Domains: Replace plain integer with NULL pointer in domain.c file
PM / Domains: Add missing static storage class specifier in domain.c file
PM / Domains: Allow device callbacks to be added at any time
PM / Domains: Add device domain data reference counter
PM / Domains: Add preliminary support for cpuidle, v2
PM / Domains: Do not stop devices after restoring their states
PM / Domains: Use subsystem runtime suspend/resume callbacks by default
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cpuidle.h | 1 | ||||
-rw-r--r-- | include/linux/pm_domain.h | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index ca6cdf55eb18..89dcd30ac8ea 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -47,6 +47,7 @@ struct cpuidle_state { | |||
47 | unsigned int exit_latency; /* in US */ | 47 | unsigned int exit_latency; /* in US */ |
48 | int power_usage; /* in mW */ | 48 | int power_usage; /* in mW */ |
49 | unsigned int target_residency; /* in US */ | 49 | unsigned int target_residency; /* in US */ |
50 | bool disabled; /* disabled on all CPUs */ | ||
50 | 51 | ||
51 | int (*enter) (struct cpuidle_device *dev, | 52 | int (*enter) (struct cpuidle_device *dev, |
52 | struct cpuidle_driver *drv, | 53 | struct cpuidle_driver *drv, |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 30f794eb3826..a7d6172922d4 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
17 | #include <linux/notifier.h> | 17 | #include <linux/notifier.h> |
18 | #include <linux/cpuidle.h> | ||
18 | 19 | ||
19 | enum gpd_status { | 20 | enum gpd_status { |
20 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ | 21 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ |
@@ -45,6 +46,11 @@ struct gpd_dev_ops { | |||
45 | bool (*active_wakeup)(struct device *dev); | 46 | bool (*active_wakeup)(struct device *dev); |
46 | }; | 47 | }; |
47 | 48 | ||
49 | struct gpd_cpu_data { | ||
50 | unsigned int saved_exit_latency; | ||
51 | struct cpuidle_state *idle_state; | ||
52 | }; | ||
53 | |||
48 | struct generic_pm_domain { | 54 | struct generic_pm_domain { |
49 | struct dev_pm_domain domain; /* PM domain operations */ | 55 | struct dev_pm_domain domain; /* PM domain operations */ |
50 | struct list_head gpd_list_node; /* Node in the global PM domains list */ | 56 | struct list_head gpd_list_node; /* Node in the global PM domains list */ |
@@ -75,6 +81,7 @@ struct generic_pm_domain { | |||
75 | bool max_off_time_changed; | 81 | bool max_off_time_changed; |
76 | bool cached_power_down_ok; | 82 | bool cached_power_down_ok; |
77 | struct device_node *of_node; /* Node in device tree */ | 83 | struct device_node *of_node; /* Node in device tree */ |
84 | struct gpd_cpu_data *cpu_data; | ||
78 | }; | 85 | }; |
79 | 86 | ||
80 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) | 87 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) |
@@ -105,6 +112,7 @@ struct generic_pm_domain_data { | |||
105 | struct gpd_timing_data td; | 112 | struct gpd_timing_data td; |
106 | struct notifier_block nb; | 113 | struct notifier_block nb; |
107 | struct mutex lock; | 114 | struct mutex lock; |
115 | unsigned int refcount; | ||
108 | bool need_restore; | 116 | bool need_restore; |
109 | bool always_on; | 117 | bool always_on; |
110 | }; | 118 | }; |
@@ -155,6 +163,8 @@ extern int pm_genpd_add_callbacks(struct device *dev, | |||
155 | struct gpd_dev_ops *ops, | 163 | struct gpd_dev_ops *ops, |
156 | struct gpd_timing_data *td); | 164 | struct gpd_timing_data *td); |
157 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); | 165 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); |
166 | extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); | ||
167 | extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); | ||
158 | extern void pm_genpd_init(struct generic_pm_domain *genpd, | 168 | extern void pm_genpd_init(struct generic_pm_domain *genpd, |
159 | struct dev_power_governor *gov, bool is_off); | 169 | struct dev_power_governor *gov, bool is_off); |
160 | 170 | ||
@@ -211,6 +221,14 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td) | |||
211 | { | 221 | { |
212 | return -ENOSYS; | 222 | return -ENOSYS; |
213 | } | 223 | } |
224 | static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) | ||
225 | { | ||
226 | return -ENOSYS; | ||
227 | } | ||
228 | static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) | ||
229 | { | ||
230 | return -ENOSYS; | ||
231 | } | ||
214 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, | 232 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, |
215 | struct dev_power_governor *gov, bool is_off) | 233 | struct dev_power_governor *gov, bool is_off) |
216 | { | 234 | { |