aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-22 16:36:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-22 16:36:52 -0400
commit7100e505b76b4e2efd88b2459d1a932214e29f8a (patch)
treea8eae8687dc1511c89463b1eb93c8349a7471ab3 /include
parentcb47c1831fa406c964468b259f2082c16cc3f757 (diff)
parent75a4161a58dd157a2bd2dc8e9986e45b62ac46cf (diff)
Merge tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: - ACPI conversion to PM handling based on struct dev_pm_ops. - Conversion of a number of platform drivers to PM handling based on struct dev_pm_ops and removal of empty legacy PM callbacks from a couple of PCI drivers. - Suspend-to-both for in-kernel hibernation from Bojan Smojver. - cpuidle fixes and cleanups from ShuoX Liu, Daniel Lezcano and Preeti Murthy. - cpufreq bug fixes from Jonghwa Lee and Stephen Boyd. - Suspend and hibernate fixes from Srivatsa Bhat and Colin Cross. - Generic PM domains framework updates. - RTC CMOS wakeup signaling update from Paul Fox. - sparse warnings fixes from Sachin Kamat. - Build warnings fixes for the generic PM domains framework and PM sysfs code. - sysfs switch for printing device suspend times from Sameer Nanda. - Documentation fix from Oskar Schirmer. * tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (70 commits) cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch EXYNOS: bugfix on retrieving old_index from freqs.old PM / Sleep: call early resume handlers when suspend_noirq fails PM / QoS: Use NULL pointer instead of plain integer in qos.c PM / QoS: Use NULL pointer instead of plain integer in pm_qos.h PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock PM / Sleep: Add missing static storage class specifiers in main.c cpuilde / ACPI: remove time from acpi_processor_cx structure cpuidle / ACPI: remove usage from acpi_processor_cx structure cpuidle / ACPI : remove latency_ticks from acpi_processor_cx structure rtc-cmos: report wakeups from interrupt handler PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset olpc-xo15-sci: Use struct dev_pm_ops for power management 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 / crypto / ux500: Use struct dev_pm_ops for power management PM / IPMI: Remove empty legacy PCI PM callbacks tpm_nsc: Use struct dev_pm_ops for power management tpm_tis: Use struct dev_pm_ops for power management ...
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h5
-rw-r--r--include/acpi/processor.h7
-rw-r--r--include/linux/cpuidle.h20
-rw-r--r--include/linux/pm_domain.h18
-rw-r--r--include/linux/pm_qos.h2
-rw-r--r--include/linux/suspend.h6
6 files changed, 38 insertions, 20 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 9e6e1c6eb60a..18fd41033e03 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -117,9 +117,6 @@ struct acpi_device;
117typedef int (*acpi_op_add) (struct acpi_device * device); 117typedef int (*acpi_op_add) (struct acpi_device * device);
118typedef int (*acpi_op_remove) (struct acpi_device * device, int type); 118typedef int (*acpi_op_remove) (struct acpi_device * device, int type);
119typedef int (*acpi_op_start) (struct acpi_device * device); 119typedef int (*acpi_op_start) (struct acpi_device * device);
120typedef int (*acpi_op_suspend) (struct acpi_device * device,
121 pm_message_t state);
122typedef int (*acpi_op_resume) (struct acpi_device * device);
123typedef int (*acpi_op_bind) (struct acpi_device * device); 120typedef int (*acpi_op_bind) (struct acpi_device * device);
124typedef int (*acpi_op_unbind) (struct acpi_device * device); 121typedef int (*acpi_op_unbind) (struct acpi_device * device);
125typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); 122typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
@@ -133,8 +130,6 @@ struct acpi_device_ops {
133 acpi_op_add add; 130 acpi_op_add add;
134 acpi_op_remove remove; 131 acpi_op_remove remove;
135 acpi_op_start start; 132 acpi_op_start start;
136 acpi_op_suspend suspend;
137 acpi_op_resume resume;
138 acpi_op_bind bind; 133 acpi_op_bind bind;
139 acpi_op_unbind unbind; 134 acpi_op_unbind unbind;
140 acpi_op_notify notify; 135 acpi_op_notify notify;
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 9d650476d5dc..64ec644808bc 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -59,10 +59,7 @@ struct acpi_processor_cx {
59 u8 entry_method; 59 u8 entry_method;
60 u8 index; 60 u8 index;
61 u32 latency; 61 u32 latency;
62 u32 latency_ticks;
63 u32 power; 62 u32 power;
64 u32 usage;
65 u64 time;
66 u8 bm_sts_skip; 63 u8 bm_sts_skip;
67 char desc[ACPI_CX_DESC_LEN]; 64 char desc[ACPI_CX_DESC_LEN];
68}; 65};
@@ -334,8 +331,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr);
334int acpi_processor_hotplug(struct acpi_processor *pr); 331int acpi_processor_hotplug(struct acpi_processor *pr);
335int acpi_processor_power_exit(struct acpi_processor *pr, 332int acpi_processor_power_exit(struct acpi_processor *pr,
336 struct acpi_device *device); 333 struct acpi_device *device);
337int acpi_processor_suspend(struct acpi_device * device, pm_message_t state); 334int acpi_processor_suspend(struct device *dev);
338int acpi_processor_resume(struct acpi_device * device); 335int acpi_processor_resume(struct device *dev);
339extern struct cpuidle_driver acpi_idle_driver; 336extern struct cpuidle_driver acpi_idle_driver;
340 337
341/* in processor_thermal.c */ 338/* in processor_thermal.c */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 6c26a3da0e03..89dcd30ac8ea 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -34,6 +34,7 @@ struct cpuidle_driver;
34struct cpuidle_state_usage { 34struct cpuidle_state_usage {
35 void *driver_data; 35 void *driver_data;
36 36
37 unsigned long long disable;
37 unsigned long long usage; 38 unsigned long long usage;
38 unsigned long long time; /* in US */ 39 unsigned long long time; /* in US */
39}; 40};
@@ -46,7 +47,7 @@ struct cpuidle_state {
46 unsigned int exit_latency; /* in US */ 47 unsigned int exit_latency; /* in US */
47 int power_usage; /* in mW */ 48 int power_usage; /* in mW */
48 unsigned int target_residency; /* in US */ 49 unsigned int target_residency; /* in US */
49 unsigned int disable; 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,
@@ -136,13 +137,17 @@ struct cpuidle_driver {
136extern void disable_cpuidle(void); 137extern void disable_cpuidle(void);
137extern int cpuidle_idle_call(void); 138extern int cpuidle_idle_call(void);
138extern int cpuidle_register_driver(struct cpuidle_driver *drv); 139extern int cpuidle_register_driver(struct cpuidle_driver *drv);
139struct cpuidle_driver *cpuidle_get_driver(void); 140extern struct cpuidle_driver *cpuidle_get_driver(void);
141extern struct cpuidle_driver *cpuidle_driver_ref(void);
142extern void cpuidle_driver_unref(void);
140extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); 143extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
141extern int cpuidle_register_device(struct cpuidle_device *dev); 144extern int cpuidle_register_device(struct cpuidle_device *dev);
142extern void cpuidle_unregister_device(struct cpuidle_device *dev); 145extern void cpuidle_unregister_device(struct cpuidle_device *dev);
143 146
144extern void cpuidle_pause_and_lock(void); 147extern void cpuidle_pause_and_lock(void);
145extern void cpuidle_resume_and_unlock(void); 148extern void cpuidle_resume_and_unlock(void);
149extern void cpuidle_pause(void);
150extern void cpuidle_resume(void);
146extern int cpuidle_enable_device(struct cpuidle_device *dev); 151extern int cpuidle_enable_device(struct cpuidle_device *dev);
147extern void cpuidle_disable_device(struct cpuidle_device *dev); 152extern void cpuidle_disable_device(struct cpuidle_device *dev);
148extern int cpuidle_wrap_enter(struct cpuidle_device *dev, 153extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
@@ -157,6 +162,8 @@ static inline int cpuidle_idle_call(void) { return -ENODEV; }
157static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 162static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
158{return -ENODEV; } 163{return -ENODEV; }
159static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } 164static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
165static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }
166static inline void cpuidle_driver_unref(void) {}
160static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } 167static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
161static inline int cpuidle_register_device(struct cpuidle_device *dev) 168static inline int cpuidle_register_device(struct cpuidle_device *dev)
162{return -ENODEV; } 169{return -ENODEV; }
@@ -164,6 +171,8 @@ static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { }
164 171
165static inline void cpuidle_pause_and_lock(void) { } 172static inline void cpuidle_pause_and_lock(void) { }
166static inline void cpuidle_resume_and_unlock(void) { } 173static inline void cpuidle_resume_and_unlock(void) { }
174static inline void cpuidle_pause(void) { }
175static inline void cpuidle_resume(void) { }
167static inline int cpuidle_enable_device(struct cpuidle_device *dev) 176static inline int cpuidle_enable_device(struct cpuidle_device *dev)
168{return -ENODEV; } 177{return -ENODEV; }
169static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } 178static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
@@ -202,14 +211,7 @@ struct cpuidle_governor {
202extern int cpuidle_register_governor(struct cpuidle_governor *gov); 211extern int cpuidle_register_governor(struct cpuidle_governor *gov);
203extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); 212extern void cpuidle_unregister_governor(struct cpuidle_governor *gov);
204 213
205#ifdef CONFIG_INTEL_IDLE
206extern int intel_idle_cpu_init(int cpu);
207#else 214#else
208static inline int intel_idle_cpu_init(int cpu) { return -1; }
209#endif
210
211#else
212static inline int intel_idle_cpu_init(int cpu) { return -1; }
213 215
214static inline int cpuidle_register_governor(struct cpuidle_governor *gov) 216static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
215{return 0;} 217{return 0;}
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
19enum gpd_status { 20enum 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
49struct gpd_cpu_data {
50 unsigned int saved_exit_latency;
51 struct cpuidle_state *idle_state;
52};
53
48struct generic_pm_domain { 54struct 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
80static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) 87static 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);
157extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); 165extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
166extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
167extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd);
158extern void pm_genpd_init(struct generic_pm_domain *genpd, 168extern 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}
224static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
225{
226 return -ENOSYS;
227}
228static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd)
229{
230 return -ENOSYS;
231}
214static inline void pm_genpd_init(struct generic_pm_domain *genpd, 232static 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{
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index 233149cb19f4..9924ea1f22e0 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -66,7 +66,7 @@ enum pm_qos_req_action {
66 66
67static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) 67static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
68{ 68{
69 return req->dev != 0; 69 return req->dev != NULL;
70} 70}
71 71
72int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, 72int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index cd83059fb592..0c808d7fa579 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -408,6 +408,12 @@ static inline void unlock_system_sleep(void) {}
408 408
409#endif /* !CONFIG_PM_SLEEP */ 409#endif /* !CONFIG_PM_SLEEP */
410 410
411#ifdef CONFIG_PM_SLEEP_DEBUG
412extern bool pm_print_times_enabled;
413#else
414#define pm_print_times_enabled (false)
415#endif
416
411#ifdef CONFIG_PM_AUTOSLEEP 417#ifdef CONFIG_PM_AUTOSLEEP
412 418
413/* kernel/power/autosleep.c */ 419/* kernel/power/autosleep.c */