diff options
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 6e8fa3049e5d..87545e0f0b58 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -107,26 +107,11 @@ typedef int __bitwise suspend_state_t; | |||
107 | #define PM_SUSPEND_ON ((__force suspend_state_t) 0) | 107 | #define PM_SUSPEND_ON ((__force suspend_state_t) 0) |
108 | #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 1) | 108 | #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 1) |
109 | #define PM_SUSPEND_MEM ((__force suspend_state_t) 3) | 109 | #define PM_SUSPEND_MEM ((__force suspend_state_t) 3) |
110 | #define PM_SUSPEND_DISK ((__force suspend_state_t) 4) | 110 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) |
111 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 5) | ||
112 | |||
113 | typedef int __bitwise suspend_disk_method_t; | ||
114 | |||
115 | /* invalid must be 0 so struct pm_ops initialisers can leave it out */ | ||
116 | #define PM_DISK_INVALID ((__force suspend_disk_method_t) 0) | ||
117 | #define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 1) | ||
118 | #define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 2) | ||
119 | #define PM_DISK_REBOOT ((__force suspend_disk_method_t) 3) | ||
120 | #define PM_DISK_TEST ((__force suspend_disk_method_t) 4) | ||
121 | #define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 5) | ||
122 | #define PM_DISK_MAX ((__force suspend_disk_method_t) 6) | ||
123 | 111 | ||
124 | /** | 112 | /** |
125 | * struct pm_ops - Callbacks for managing platform dependent suspend states. | 113 | * struct pm_ops - Callbacks for managing platform dependent suspend states. |
126 | * @valid: Callback to determine whether the given state can be entered. | 114 | * @valid: Callback to determine whether the given state can be entered. |
127 | * If %CONFIG_SOFTWARE_SUSPEND is set then %PM_SUSPEND_DISK is | ||
128 | * always valid and never passed to this call. If not assigned, | ||
129 | * no suspend states are valid. | ||
130 | * Valid states are advertised in /sys/power/state but can still | 115 | * Valid states are advertised in /sys/power/state but can still |
131 | * be rejected by prepare or enter if the conditions aren't right. | 116 | * be rejected by prepare or enter if the conditions aren't right. |
132 | * There is a %pm_valid_only_mem function available that can be assigned | 117 | * There is a %pm_valid_only_mem function available that can be assigned |
@@ -140,24 +125,12 @@ typedef int __bitwise suspend_disk_method_t; | |||
140 | * | 125 | * |
141 | * @finish: Called when the system has left the given state and all devices | 126 | * @finish: Called when the system has left the given state and all devices |
142 | * are resumed. The return value is ignored. | 127 | * are resumed. The return value is ignored. |
143 | * | ||
144 | * @pm_disk_mode: The generic code always allows one of the shutdown methods | ||
145 | * %PM_DISK_SHUTDOWN, %PM_DISK_REBOOT, %PM_DISK_TEST and | ||
146 | * %PM_DISK_TESTPROC. If this variable is set, the mode it is set | ||
147 | * to is allowed in addition to those modes and is also made default. | ||
148 | * When this mode is sent selected, the @prepare call will be called | ||
149 | * before suspending to disk (if present), the @enter call should be | ||
150 | * present and will be called after all state has been saved and the | ||
151 | * machine is ready to be powered off; the @finish callback is called | ||
152 | * after state has been restored. All these calls are called with | ||
153 | * %PM_SUSPEND_DISK as the state. | ||
154 | */ | 128 | */ |
155 | struct pm_ops { | 129 | struct pm_ops { |
156 | int (*valid)(suspend_state_t state); | 130 | int (*valid)(suspend_state_t state); |
157 | int (*prepare)(suspend_state_t state); | 131 | int (*prepare)(suspend_state_t state); |
158 | int (*enter)(suspend_state_t state); | 132 | int (*enter)(suspend_state_t state); |
159 | int (*finish)(suspend_state_t state); | 133 | int (*finish)(suspend_state_t state); |
160 | suspend_disk_method_t pm_disk_mode; | ||
161 | }; | 134 | }; |
162 | 135 | ||
163 | /** | 136 | /** |
@@ -276,8 +249,6 @@ extern void device_power_up(void); | |||
276 | extern void device_resume(void); | 249 | extern void device_resume(void); |
277 | 250 | ||
278 | #ifdef CONFIG_PM | 251 | #ifdef CONFIG_PM |
279 | extern suspend_disk_method_t pm_disk_mode; | ||
280 | |||
281 | extern int device_suspend(pm_message_t state); | 252 | extern int device_suspend(pm_message_t state); |
282 | extern int device_prepare_suspend(pm_message_t state); | 253 | extern int device_prepare_suspend(pm_message_t state); |
283 | 254 | ||