aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 21:32:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 21:32:35 -0400
commit16642a2e7be23bbda013fc32d8f6c68982eab603 (patch)
tree346ae485f485f6901e5d8150f0d34d178a7dd448 /include/linux
parent51562cba98939da0a1d10fe7c25359b77a069033 (diff)
parentb9142167a2bb979b58b98ffcd928a311b55cbd9f (diff)
Merge tag 'pm-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael J Wysocki: - Improved system suspend/resume and runtime PM handling for the SH TMU, CMT and MTU2 clock event devices (also used by ARM/shmobile). - Generic PM domains framework extensions related to cpuidle support and domain objects lookup using names. - ARM/shmobile power management updates including improved support for the SH7372's A4S power domain containing the CPU core. - cpufreq changes related to AMD CPUs support from Matthew Garrett, Andre Przywara and Borislav Petkov. - cpu0 cpufreq driver from Shawn Guo. - cpufreq governor fixes related to the relaxing of limit from Michal Pecio. - OMAP cpufreq updates from Axel Lin and Richard Zhao. - cpuidle ladder governor fixes related to the disabling of states from Carsten Emde and me. - Runtime PM core updates related to the interactions with the system suspend core from Alan Stern and Kevin Hilman. - Wakeup sources modification allowing more helper functions to be called from interrupt context from John Stultz and additional diagnostic code from Todd Poynor. - System suspend error code path fix from Feng Hong. Fixed up conflicts in cpufreq/powernow-k8 that stemmed from the workqueue fixes conflicting fairly badly with the removal of support for hardware P-state chips. The changes were independent but somewhat intertwined. * tag 'pm-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits) Revert "PM QoS: Use spinlock in the per-device PM QoS constraints code" PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2 cpuidle: rename function name "__cpuidle_register_driver", v2 cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_hwmod_name cpuidle: remove some empty lines PM: Prevent runtime suspend during system resume PM QoS: Use spinlock in the per-device PM QoS constraints code PM / Sleep: use resume event when call dpm_resume_early cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure ACPI / processor: remove pointless variable initialization ACPI / processor: remove unused function parameter cpufreq: OMAP: remove loops_per_jiffy recalculate for smp sections: fix section conflicts in drivers/cpufreq cpufreq: conservative: update frequency when limits are relaxed cpufreq / ondemand: update frequency when limits are relaxed properly __init-annotate pm_sysrq_init() cpufreq: Add a generic cpufreq-cpu0 driver PM / OPP: Initialize OPP table from device tree ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp cpufreq: Remove support for hardware P-state chips from powernow-k8 ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/clockchips.h8
-rw-r--r--include/linux/device.h7
-rw-r--r--include/linux/opp.h8
-rw-r--r--include/linux/pm.h2
-rw-r--r--include/linux/pm_domain.h92
5 files changed, 97 insertions, 20 deletions
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index acba894374a1..8a7096fcb01e 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -97,6 +97,8 @@ struct clock_event_device {
97 void (*broadcast)(const struct cpumask *mask); 97 void (*broadcast)(const struct cpumask *mask);
98 void (*set_mode)(enum clock_event_mode mode, 98 void (*set_mode)(enum clock_event_mode mode,
99 struct clock_event_device *); 99 struct clock_event_device *);
100 void (*suspend)(struct clock_event_device *);
101 void (*resume)(struct clock_event_device *);
100 unsigned long min_delta_ticks; 102 unsigned long min_delta_ticks;
101 unsigned long max_delta_ticks; 103 unsigned long max_delta_ticks;
102 104
@@ -156,6 +158,9 @@ clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec)
156 freq, minsec); 158 freq, minsec);
157} 159}
158 160
161extern void clockevents_suspend(void);
162extern void clockevents_resume(void);
163
159#ifdef CONFIG_GENERIC_CLOCKEVENTS 164#ifdef CONFIG_GENERIC_CLOCKEVENTS
160extern void clockevents_notify(unsigned long reason, void *arg); 165extern void clockevents_notify(unsigned long reason, void *arg);
161#else 166#else
@@ -164,6 +169,9 @@ extern void clockevents_notify(unsigned long reason, void *arg);
164 169
165#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */ 170#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
166 171
172static inline void clockevents_suspend(void) {}
173static inline void clockevents_resume(void) {}
174
167#define clockevents_notify(reason, arg) do { } while (0) 175#define clockevents_notify(reason, arg) do { } while (0)
168 176
169#endif 177#endif
diff --git a/include/linux/device.h b/include/linux/device.h
index af92883bb4a6..86ef6ab553b1 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -776,6 +776,13 @@ static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
776 dev->power.ignore_children = enable; 776 dev->power.ignore_children = enable;
777} 777}
778 778
779static inline void dev_pm_syscore_device(struct device *dev, bool val)
780{
781#ifdef CONFIG_PM_SLEEP
782 dev->power.syscore = val;
783#endif
784}
785
779static inline void device_lock(struct device *dev) 786static inline void device_lock(struct device *dev)
780{ 787{
781 mutex_lock(&dev->mutex); 788 mutex_lock(&dev->mutex);
diff --git a/include/linux/opp.h b/include/linux/opp.h
index 2a4e5faee904..214e0ebcb84d 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -48,6 +48,14 @@ int opp_disable(struct device *dev, unsigned long freq);
48 48
49struct srcu_notifier_head *opp_get_notifier(struct device *dev); 49struct srcu_notifier_head *opp_get_notifier(struct device *dev);
50 50
51#ifdef CONFIG_OF
52int of_init_opp_table(struct device *dev);
53#else
54static inline int of_init_opp_table(struct device *dev)
55{
56 return -EINVAL;
57}
58#endif /* CONFIG_OF */
51#else 59#else
52static inline unsigned long opp_get_voltage(struct opp *opp) 60static inline unsigned long opp_get_voltage(struct opp *opp)
53{ 61{
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 88f034a23f2c..007e687c4f69 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -510,12 +510,14 @@ struct dev_pm_info {
510 bool is_prepared:1; /* Owned by the PM core */ 510 bool is_prepared:1; /* Owned by the PM core */
511 bool is_suspended:1; /* Ditto */ 511 bool is_suspended:1; /* Ditto */
512 bool ignore_children:1; 512 bool ignore_children:1;
513 bool early_init:1; /* Owned by the PM core */
513 spinlock_t lock; 514 spinlock_t lock;
514#ifdef CONFIG_PM_SLEEP 515#ifdef CONFIG_PM_SLEEP
515 struct list_head entry; 516 struct list_head entry;
516 struct completion completion; 517 struct completion completion;
517 struct wakeup_source *wakeup; 518 struct wakeup_source *wakeup;
518 bool wakeup_path:1; 519 bool wakeup_path:1;
520 bool syscore:1;
519#else 521#else
520 unsigned int should_wakeup:1; 522 unsigned int should_wakeup:1;
521#endif 523#endif
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index a7d6172922d4..7c1d252b20c0 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -114,7 +114,6 @@ struct generic_pm_domain_data {
114 struct mutex lock; 114 struct mutex lock;
115 unsigned int refcount; 115 unsigned int refcount;
116 bool need_restore; 116 bool need_restore;
117 bool always_on;
118}; 117};
119 118
120#ifdef CONFIG_PM_GENERIC_DOMAINS 119#ifdef CONFIG_PM_GENERIC_DOMAINS
@@ -139,36 +138,32 @@ extern int __pm_genpd_of_add_device(struct device_node *genpd_node,
139 struct device *dev, 138 struct device *dev,
140 struct gpd_timing_data *td); 139 struct gpd_timing_data *td);
141 140
142static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 141extern int __pm_genpd_name_add_device(const char *domain_name,
143 struct device *dev) 142 struct device *dev,
144{ 143 struct gpd_timing_data *td);
145 return __pm_genpd_add_device(genpd, dev, NULL);
146}
147
148static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
149 struct device *dev)
150{
151 return __pm_genpd_of_add_device(genpd_node, dev, NULL);
152}
153 144
154extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, 145extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
155 struct device *dev); 146 struct device *dev);
156extern void pm_genpd_dev_always_on(struct device *dev, bool val);
157extern void pm_genpd_dev_need_restore(struct device *dev, bool val); 147extern void pm_genpd_dev_need_restore(struct device *dev, bool val);
158extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 148extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
159 struct generic_pm_domain *new_subdomain); 149 struct generic_pm_domain *new_subdomain);
150extern int pm_genpd_add_subdomain_names(const char *master_name,
151 const char *subdomain_name);
160extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, 152extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
161 struct generic_pm_domain *target); 153 struct generic_pm_domain *target);
162extern int pm_genpd_add_callbacks(struct device *dev, 154extern int pm_genpd_add_callbacks(struct device *dev,
163 struct gpd_dev_ops *ops, 155 struct gpd_dev_ops *ops,
164 struct gpd_timing_data *td); 156 struct gpd_timing_data *td);
165extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); 157extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
166extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); 158extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
167extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); 159extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
160extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
161extern int pm_genpd_name_detach_cpuidle(const char *name);
168extern void pm_genpd_init(struct generic_pm_domain *genpd, 162extern void pm_genpd_init(struct generic_pm_domain *genpd,
169 struct dev_power_governor *gov, bool is_off); 163 struct dev_power_governor *gov, bool is_off);
170 164
171extern int pm_genpd_poweron(struct generic_pm_domain *genpd); 165extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
166extern int pm_genpd_name_poweron(const char *domain_name);
172 167
173extern bool default_stop_ok(struct device *dev); 168extern bool default_stop_ok(struct device *dev);
174 169
@@ -189,8 +184,15 @@ static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd,
189{ 184{
190 return -ENOSYS; 185 return -ENOSYS;
191} 186}
192static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 187static inline int __pm_genpd_of_add_device(struct device_node *genpd_node,
193 struct device *dev) 188 struct device *dev,
189 struct gpd_timing_data *td)
190{
191 return -ENOSYS;
192}
193static inline int __pm_genpd_name_add_device(const char *domain_name,
194 struct device *dev,
195 struct gpd_timing_data *td)
194{ 196{
195 return -ENOSYS; 197 return -ENOSYS;
196} 198}
@@ -199,13 +201,17 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
199{ 201{
200 return -ENOSYS; 202 return -ENOSYS;
201} 203}
202static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {}
203static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} 204static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {}
204static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 205static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
205 struct generic_pm_domain *new_sd) 206 struct generic_pm_domain *new_sd)
206{ 207{
207 return -ENOSYS; 208 return -ENOSYS;
208} 209}
210static inline int pm_genpd_add_subdomain_names(const char *master_name,
211 const char *subdomain_name)
212{
213 return -ENOSYS;
214}
209static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, 215static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
210 struct generic_pm_domain *target) 216 struct generic_pm_domain *target)
211{ 217{
@@ -221,11 +227,19 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
221{ 227{
222 return -ENOSYS; 228 return -ENOSYS;
223} 229}
224static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) 230static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
225{ 231{
226 return -ENOSYS; 232 return -ENOSYS;
227} 233}
228static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) 234static inline int pm_genpd_name_attach_cpuidle(const char *name, int state)
235{
236 return -ENOSYS;
237}
238static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd)
239{
240 return -ENOSYS;
241}
242static inline int pm_genpd_name_detach_cpuidle(const char *name)
229{ 243{
230 return -ENOSYS; 244 return -ENOSYS;
231} 245}
@@ -237,6 +251,10 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
237{ 251{
238 return -ENOSYS; 252 return -ENOSYS;
239} 253}
254static inline int pm_genpd_name_poweron(const char *domain_name)
255{
256 return -ENOSYS;
257}
240static inline bool default_stop_ok(struct device *dev) 258static inline bool default_stop_ok(struct device *dev)
241{ 259{
242 return false; 260 return false;
@@ -245,6 +263,24 @@ static inline bool default_stop_ok(struct device *dev)
245#define pm_domain_always_on_gov NULL 263#define pm_domain_always_on_gov NULL
246#endif 264#endif
247 265
266static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
267 struct device *dev)
268{
269 return __pm_genpd_add_device(genpd, dev, NULL);
270}
271
272static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
273 struct device *dev)
274{
275 return __pm_genpd_of_add_device(genpd_node, dev, NULL);
276}
277
278static inline int pm_genpd_name_add_device(const char *domain_name,
279 struct device *dev)
280{
281 return __pm_genpd_name_add_device(domain_name, dev, NULL);
282}
283
248static inline int pm_genpd_remove_callbacks(struct device *dev) 284static inline int pm_genpd_remove_callbacks(struct device *dev)
249{ 285{
250 return __pm_genpd_remove_callbacks(dev, true); 286 return __pm_genpd_remove_callbacks(dev, true);
@@ -258,4 +294,20 @@ static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
258static inline void pm_genpd_poweroff_unused(void) {} 294static inline void pm_genpd_poweroff_unused(void) {}
259#endif 295#endif
260 296
297#ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP
298extern void pm_genpd_syscore_switch(struct device *dev, bool suspend);
299#else
300static inline void pm_genpd_syscore_switch(struct device *dev, bool suspend) {}
301#endif
302
303static inline void pm_genpd_syscore_poweroff(struct device *dev)
304{
305 pm_genpd_syscore_switch(dev, true);
306}
307
308static inline void pm_genpd_syscore_poweron(struct device *dev)
309{
310 pm_genpd_syscore_switch(dev, false);
311}
312
261#endif /* _LINUX_PM_DOMAIN_H */ 313#endif /* _LINUX_PM_DOMAIN_H */