Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * pm.h - Power management interface |
| 3 | * |
| 4 | * Copyright (C) 2000 Andrew Henroid |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
| 20 | |
| 21 | #ifndef _LINUX_PM_H |
| 22 | #define _LINUX_PM_H |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include <linux/list.h> |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 25 | #include <linux/workqueue.h> |
| 26 | #include <linux/spinlock.h> |
| 27 | #include <linux/wait.h> |
| 28 | #include <linux/timer.h> |
Rafael J. Wysocki | 5af84b8 | 2010-01-23 22:23:32 +0100 | [diff] [blame] | 29 | #include <linux/completion.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | * Callbacks for platform drivers to implement. |
| 33 | */ |
| 34 | extern void (*pm_idle)(void); |
| 35 | extern void (*pm_power_off)(void); |
Rafael J. Wysocki | bd804eb | 2007-07-19 01:47:40 -0700 | [diff] [blame] | 36 | extern void (*pm_power_off_prepare)(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | /* |
| 39 | * Device power management |
| 40 | */ |
| 41 | |
| 42 | struct device; |
| 43 | |
Alan Stern | 7490e44 | 2010-09-25 23:35:15 +0200 | [diff] [blame] | 44 | #ifdef CONFIG_PM |
| 45 | extern const char power_group_name[]; /* = "power" */ |
| 46 | #else |
| 47 | #define power_group_name NULL |
| 48 | #endif |
| 49 | |
Pavel Machek | ca078ba | 2005-09-03 15:56:57 -0700 | [diff] [blame] | 50 | typedef struct pm_message { |
| 51 | int event; |
| 52 | } pm_message_t; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 54 | /** |
Rafael J. Wysocki | adf0949 | 2008-10-06 22:46:05 +0200 | [diff] [blame] | 55 | * struct dev_pm_ops - device PM callbacks |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 56 | * |
David Brownell | 82bb67f | 2006-08-14 23:11:04 -0700 | [diff] [blame] | 57 | * Several driver power state transitions are externally visible, affecting |
| 58 | * the state of pending I/O queues and (for drivers that touch hardware) |
| 59 | * interrupts, wakeups, DMA, and other hardware state. There may also be |
| 60 | * internal transitions to various low power modes, which are transparent |
| 61 | * to the rest of the driver stack (such as a driver that's ON gating off |
| 62 | * clocks which are not in active use). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | * |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 64 | * The externally visible transitions are handled with the help of the following |
| 65 | * callbacks included in this structure: |
| 66 | * |
| 67 | * @prepare: Prepare the device for the upcoming transition, but do NOT change |
| 68 | * its hardware state. Prevent new children of the device from being |
| 69 | * registered after @prepare() returns (the driver's subsystem and |
| 70 | * generally the rest of the kernel is supposed to prevent new calls to the |
| 71 | * probe method from being made too once @prepare() has succeeded). If |
| 72 | * @prepare() detects a situation it cannot handle (e.g. registration of a |
| 73 | * child already in progress), it may return -EAGAIN, so that the PM core |
| 74 | * can execute it once again (e.g. after the new child has been registered) |
| 75 | * to recover from the race condition. This method is executed for all |
| 76 | * kinds of suspend transitions and is followed by one of the suspend |
| 77 | * callbacks: @suspend(), @freeze(), or @poweroff(). |
| 78 | * The PM core executes @prepare() for all devices before starting to |
| 79 | * execute suspend callbacks for any of them, so drivers may assume all of |
| 80 | * the other devices to be present and functional while @prepare() is being |
| 81 | * executed. In particular, it is safe to make GFP_KERNEL memory |
| 82 | * allocations from within @prepare(). However, drivers may NOT assume |
| 83 | * anything about the availability of the user space at that time and it |
| 84 | * is not correct to request firmware from within @prepare() (it's too |
| 85 | * late to do that). [To work around this limitation, drivers may |
| 86 | * register suspend and hibernation notifiers that are executed before the |
| 87 | * freezing of tasks.] |
| 88 | * |
| 89 | * @complete: Undo the changes made by @prepare(). This method is executed for |
| 90 | * all kinds of resume transitions, following one of the resume callbacks: |
| 91 | * @resume(), @thaw(), @restore(). Also called if the state transition |
| 92 | * fails before the driver's suspend callback (@suspend(), @freeze(), |
| 93 | * @poweroff()) can be executed (e.g. if the suspend callback fails for one |
| 94 | * of the other devices that the PM core has unsuccessfully attempted to |
| 95 | * suspend earlier). |
| 96 | * The PM core executes @complete() after it has executed the appropriate |
| 97 | * resume callback for all devices. |
| 98 | * |
| 99 | * @suspend: Executed before putting the system into a sleep state in which the |
| 100 | * contents of main memory are preserved. Quiesce the device, put it into |
| 101 | * a low power state appropriate for the upcoming system state (such as |
| 102 | * PCI_D3hot), and enable wakeup events as appropriate. |
| 103 | * |
| 104 | * @resume: Executed after waking the system up from a sleep state in which the |
| 105 | * contents of main memory were preserved. Put the device into the |
| 106 | * appropriate state, according to the information saved in memory by the |
| 107 | * preceding @suspend(). The driver starts working again, responding to |
| 108 | * hardware events and software requests. The hardware may have gone |
| 109 | * through a power-off reset, or it may have maintained state from the |
| 110 | * previous suspend() which the driver may rely on while resuming. On most |
| 111 | * platforms, there are no restrictions on availability of resources like |
| 112 | * clocks during @resume(). |
| 113 | * |
| 114 | * @freeze: Hibernation-specific, executed before creating a hibernation image. |
| 115 | * Quiesce operations so that a consistent image can be created, but do NOT |
| 116 | * otherwise put the device into a low power device state and do NOT emit |
| 117 | * system wakeup events. Save in main memory the device settings to be |
| 118 | * used by @restore() during the subsequent resume from hibernation or by |
| 119 | * the subsequent @thaw(), if the creation of the image or the restoration |
| 120 | * of main memory contents from it fails. |
| 121 | * |
| 122 | * @thaw: Hibernation-specific, executed after creating a hibernation image OR |
| 123 | * if the creation of the image fails. Also executed after a failing |
| 124 | * attempt to restore the contents of main memory from such an image. |
| 125 | * Undo the changes made by the preceding @freeze(), so the device can be |
| 126 | * operated in the same way as immediately before the call to @freeze(). |
| 127 | * |
| 128 | * @poweroff: Hibernation-specific, executed after saving a hibernation image. |
| 129 | * Quiesce the device, put it into a low power state appropriate for the |
| 130 | * upcoming system state (such as PCI_D3hot), and enable wakeup events as |
| 131 | * appropriate. |
| 132 | * |
| 133 | * @restore: Hibernation-specific, executed after restoring the contents of main |
| 134 | * memory from a hibernation image. Driver starts working again, |
| 135 | * responding to hardware events and software requests. Drivers may NOT |
| 136 | * make ANY assumptions about the hardware state right prior to @restore(). |
| 137 | * On most platforms, there are no restrictions on availability of |
| 138 | * resources like clocks during @restore(). |
| 139 | * |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 140 | * @suspend_noirq: Complete the operations of ->suspend() by carrying out any |
| 141 | * actions required for suspending the device that need interrupts to be |
| 142 | * disabled |
| 143 | * |
| 144 | * @resume_noirq: Prepare for the execution of ->resume() by carrying out any |
| 145 | * actions required for resuming the device that need interrupts to be |
| 146 | * disabled |
| 147 | * |
| 148 | * @freeze_noirq: Complete the operations of ->freeze() by carrying out any |
| 149 | * actions required for freezing the device that need interrupts to be |
| 150 | * disabled |
| 151 | * |
| 152 | * @thaw_noirq: Prepare for the execution of ->thaw() by carrying out any |
| 153 | * actions required for thawing the device that need interrupts to be |
| 154 | * disabled |
| 155 | * |
| 156 | * @poweroff_noirq: Complete the operations of ->poweroff() by carrying out any |
| 157 | * actions required for handling the device that need interrupts to be |
| 158 | * disabled |
| 159 | * |
| 160 | * @restore_noirq: Prepare for the execution of ->restore() by carrying out any |
| 161 | * actions required for restoring the operations of the device that need |
| 162 | * interrupts to be disabled |
| 163 | * |
Rafael J. Wysocki | adf0949 | 2008-10-06 22:46:05 +0200 | [diff] [blame] | 164 | * All of the above callbacks, except for @complete(), return error codes. |
| 165 | * However, the error codes returned by the resume operations, @resume(), |
| 166 | * @thaw(), @restore(), @resume_noirq(), @thaw_noirq(), and @restore_noirq() do |
| 167 | * not cause the PM core to abort the resume transition during which they are |
| 168 | * returned. The error codes returned in that cases are only printed by the PM |
| 169 | * core to the system logs for debugging purposes. Still, it is recommended |
| 170 | * that drivers only return error codes from their resume methods in case of an |
| 171 | * unrecoverable failure (i.e. when the device being handled refuses to resume |
| 172 | * and becomes unusable) to allow us to modify the PM core in the future, so |
| 173 | * that it can avoid attempting to handle devices that failed to resume and |
| 174 | * their children. |
| 175 | * |
| 176 | * It is allowed to unregister devices while the above callbacks are being |
| 177 | * executed. However, it is not allowed to unregister a device from within any |
| 178 | * of its own callbacks. |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 179 | * |
| 180 | * There also are the following callbacks related to run-time power management |
| 181 | * of devices: |
| 182 | * |
| 183 | * @runtime_suspend: Prepare the device for a condition in which it won't be |
| 184 | * able to communicate with the CPU(s) and RAM due to power management. |
| 185 | * This need not mean that the device should be put into a low power state. |
| 186 | * For example, if the device is behind a link which is about to be turned |
| 187 | * off, the device may remain at full power. If the device does go to low |
Rafael J. Wysocki | 7a1a8eb | 2009-12-03 21:19:18 +0100 | [diff] [blame] | 188 | * power and is capable of generating run-time wake-up events, remote |
| 189 | * wake-up (i.e., a hardware mechanism allowing the device to request a |
| 190 | * change of its power state via a wake-up event, such as PCI PME) should |
| 191 | * be enabled for it. |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 192 | * |
| 193 | * @runtime_resume: Put the device into the fully active state in response to a |
| 194 | * wake-up event generated by hardware or at the request of software. If |
| 195 | * necessary, put the device into the full power state and restore its |
| 196 | * registers, so that it is fully operational. |
| 197 | * |
| 198 | * @runtime_idle: Device appears to be inactive and it might be put into a low |
| 199 | * power state if all of the necessary conditions are satisfied. Check |
| 200 | * these conditions and handle the device as appropriate, possibly queueing |
| 201 | * a suspend request for it. The return value is ignored by the PM core. |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 202 | */ |
| 203 | |
Rafael J. Wysocki | adf0949 | 2008-10-06 22:46:05 +0200 | [diff] [blame] | 204 | struct dev_pm_ops { |
| 205 | int (*prepare)(struct device *dev); |
| 206 | void (*complete)(struct device *dev); |
| 207 | int (*suspend)(struct device *dev); |
| 208 | int (*resume)(struct device *dev); |
| 209 | int (*freeze)(struct device *dev); |
| 210 | int (*thaw)(struct device *dev); |
| 211 | int (*poweroff)(struct device *dev); |
| 212 | int (*restore)(struct device *dev); |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 213 | int (*suspend_noirq)(struct device *dev); |
| 214 | int (*resume_noirq)(struct device *dev); |
| 215 | int (*freeze_noirq)(struct device *dev); |
| 216 | int (*thaw_noirq)(struct device *dev); |
| 217 | int (*poweroff_noirq)(struct device *dev); |
| 218 | int (*restore_noirq)(struct device *dev); |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 219 | int (*runtime_suspend)(struct device *dev); |
| 220 | int (*runtime_resume)(struct device *dev); |
| 221 | int (*runtime_idle)(struct device *dev); |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 222 | }; |
| 223 | |
Rafael J. Wysocki | d690b2c | 2010-03-06 21:28:37 +0100 | [diff] [blame] | 224 | #ifdef CONFIG_PM_SLEEP |
| 225 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ |
| 226 | .suspend = suspend_fn, \ |
| 227 | .resume = resume_fn, \ |
| 228 | .freeze = suspend_fn, \ |
| 229 | .thaw = resume_fn, \ |
| 230 | .poweroff = suspend_fn, \ |
| 231 | .restore = resume_fn, |
| 232 | #else |
| 233 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) |
| 234 | #endif |
| 235 | |
| 236 | #ifdef CONFIG_PM_RUNTIME |
| 237 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ |
| 238 | .runtime_suspend = suspend_fn, \ |
| 239 | .runtime_resume = resume_fn, \ |
| 240 | .runtime_idle = idle_fn, |
| 241 | #else |
| 242 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) |
| 243 | #endif |
| 244 | |
Albin Tonnerre | 9d62ec6 | 2009-08-05 23:59:59 +0200 | [diff] [blame] | 245 | /* |
| 246 | * Use this if you want to use the same suspend and resume callbacks for suspend |
| 247 | * to RAM and hibernation. |
| 248 | */ |
| 249 | #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ |
Alexey Dobriyan | 4714521 | 2009-12-14 18:00:08 -0800 | [diff] [blame] | 250 | const struct dev_pm_ops name = { \ |
Rafael J. Wysocki | d690b2c | 2010-03-06 21:28:37 +0100 | [diff] [blame] | 251 | SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ |
Albin Tonnerre | 9d62ec6 | 2009-08-05 23:59:59 +0200 | [diff] [blame] | 252 | } |
| 253 | |
Rafael J. Wysocki | d690b2c | 2010-03-06 21:28:37 +0100 | [diff] [blame] | 254 | /* |
| 255 | * Use this for defining a set of PM operations to be used in all situations |
| 256 | * (sustem suspend, hibernation or runtime PM). |
| 257 | */ |
| 258 | #define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \ |
| 259 | const struct dev_pm_ops name = { \ |
| 260 | SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ |
| 261 | SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ |
| 262 | } |
| 263 | |
| 264 | /* |
| 265 | * Use this for subsystems (bus types, device types, device classes) that don't |
| 266 | * need any special suspend/resume handling in addition to invoking the PM |
| 267 | * callbacks provided by device drivers supporting both the system sleep PM and |
| 268 | * runtime PM, make the pm member point to generic_subsys_pm_ops. |
| 269 | */ |
Rafael J. Wysocki | aa33860 | 2011-02-11 00:06:54 +0100 | [diff] [blame] | 270 | #ifdef CONFIG_PM |
Rafael J. Wysocki | d690b2c | 2010-03-06 21:28:37 +0100 | [diff] [blame] | 271 | extern struct dev_pm_ops generic_subsys_pm_ops; |
| 272 | #define GENERIC_SUBSYS_PM_OPS (&generic_subsys_pm_ops) |
| 273 | #else |
| 274 | #define GENERIC_SUBSYS_PM_OPS NULL |
| 275 | #endif |
| 276 | |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 277 | /** |
| 278 | * PM_EVENT_ messages |
| 279 | * |
| 280 | * The following PM_EVENT_ messages are defined for the internal use of the PM |
| 281 | * core, in order to provide a mechanism allowing the high level suspend and |
| 282 | * hibernation code to convey the necessary information to the device PM core |
| 283 | * code: |
| 284 | * |
| 285 | * ON No transition. |
| 286 | * |
| 287 | * FREEZE System is going to hibernate, call ->prepare() and ->freeze() |
| 288 | * for all devices. |
| 289 | * |
| 290 | * SUSPEND System is going to suspend, call ->prepare() and ->suspend() |
| 291 | * for all devices. |
| 292 | * |
| 293 | * HIBERNATE Hibernation image has been saved, call ->prepare() and |
| 294 | * ->poweroff() for all devices. |
| 295 | * |
| 296 | * QUIESCE Contents of main memory are going to be restored from a (loaded) |
| 297 | * hibernation image, call ->prepare() and ->freeze() for all |
| 298 | * devices. |
| 299 | * |
| 300 | * RESUME System is resuming, call ->resume() and ->complete() for all |
| 301 | * devices. |
| 302 | * |
| 303 | * THAW Hibernation image has been created, call ->thaw() and |
| 304 | * ->complete() for all devices. |
| 305 | * |
| 306 | * RESTORE Contents of main memory have been restored from a hibernation |
| 307 | * image, call ->restore() and ->complete() for all devices. |
| 308 | * |
| 309 | * RECOVER Creation of a hibernation image or restoration of the main |
| 310 | * memory contents from a hibernation image has failed, call |
| 311 | * ->thaw() and ->complete() for all devices. |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 312 | * |
| 313 | * The following PM_EVENT_ messages are defined for internal use by |
| 314 | * kernel subsystems. They are never issued by the PM core. |
| 315 | * |
| 316 | * USER_SUSPEND Manual selective suspend was issued by userspace. |
| 317 | * |
| 318 | * USER_RESUME Manual selective resume was issued by userspace. |
| 319 | * |
| 320 | * REMOTE_WAKEUP Remote-wakeup request was received from the device. |
| 321 | * |
| 322 | * AUTO_SUSPEND Automatic (device idle) runtime suspend was |
| 323 | * initiated by the subsystem. |
| 324 | * |
| 325 | * AUTO_RESUME Automatic (device needed) runtime resume was |
| 326 | * requested by a driver. |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 327 | */ |
| 328 | |
Rafael J. Wysocki | 1a9a915 | 2011-09-29 22:29:44 +0200 | [diff] [blame] | 329 | #define PM_EVENT_INVALID (-1) |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 330 | #define PM_EVENT_ON 0x0000 |
| 331 | #define PM_EVENT_FREEZE 0x0001 |
| 332 | #define PM_EVENT_SUSPEND 0x0002 |
| 333 | #define PM_EVENT_HIBERNATE 0x0004 |
| 334 | #define PM_EVENT_QUIESCE 0x0008 |
| 335 | #define PM_EVENT_RESUME 0x0010 |
| 336 | #define PM_EVENT_THAW 0x0020 |
| 337 | #define PM_EVENT_RESTORE 0x0040 |
| 338 | #define PM_EVENT_RECOVER 0x0080 |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 339 | #define PM_EVENT_USER 0x0100 |
| 340 | #define PM_EVENT_REMOTE 0x0200 |
| 341 | #define PM_EVENT_AUTO 0x0400 |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 342 | |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 343 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) |
| 344 | #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND) |
| 345 | #define PM_EVENT_USER_RESUME (PM_EVENT_USER | PM_EVENT_RESUME) |
Alan Stern | 7f4f5d4 | 2008-11-17 11:14:19 -0500 | [diff] [blame] | 346 | #define PM_EVENT_REMOTE_RESUME (PM_EVENT_REMOTE | PM_EVENT_RESUME) |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 347 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) |
| 348 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 349 | |
Rafael J. Wysocki | 1a9a915 | 2011-09-29 22:29:44 +0200 | [diff] [blame] | 350 | #define PMSG_INVALID ((struct pm_message){ .event = PM_EVENT_INVALID, }) |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 351 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 352 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) |
| 353 | #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) |
| 354 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) |
| 355 | #define PMSG_HIBERNATE ((struct pm_message){ .event = PM_EVENT_HIBERNATE, }) |
| 356 | #define PMSG_RESUME ((struct pm_message){ .event = PM_EVENT_RESUME, }) |
| 357 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) |
| 358 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) |
| 359 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) |
Alan Stern | 7f4f5d4 | 2008-11-17 11:14:19 -0500 | [diff] [blame] | 360 | #define PMSG_USER_SUSPEND ((struct pm_message) \ |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 361 | { .event = PM_EVENT_USER_SUSPEND, }) |
Alan Stern | 7f4f5d4 | 2008-11-17 11:14:19 -0500 | [diff] [blame] | 362 | #define PMSG_USER_RESUME ((struct pm_message) \ |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 363 | { .event = PM_EVENT_USER_RESUME, }) |
Alan Stern | 7f4f5d4 | 2008-11-17 11:14:19 -0500 | [diff] [blame] | 364 | #define PMSG_REMOTE_RESUME ((struct pm_message) \ |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 365 | { .event = PM_EVENT_REMOTE_RESUME, }) |
Alan Stern | 7f4f5d4 | 2008-11-17 11:14:19 -0500 | [diff] [blame] | 366 | #define PMSG_AUTO_SUSPEND ((struct pm_message) \ |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 367 | { .event = PM_EVENT_AUTO_SUSPEND, }) |
Alan Stern | 7f4f5d4 | 2008-11-17 11:14:19 -0500 | [diff] [blame] | 368 | #define PMSG_AUTO_RESUME ((struct pm_message) \ |
Alan Stern | 8111d1b | 2008-07-23 21:28:37 -0700 | [diff] [blame] | 369 | { .event = PM_EVENT_AUTO_RESUME, }) |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 370 | |
Alan Stern | 5b1b0b8 | 2011-08-19 23:49:48 +0200 | [diff] [blame] | 371 | #define PMSG_IS_AUTO(msg) (((msg).event & PM_EVENT_AUTO) != 0) |
| 372 | |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 373 | /** |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 374 | * Device run-time power management status. |
| 375 | * |
| 376 | * These status labels are used internally by the PM core to indicate the |
| 377 | * current status of a device with respect to the PM core operations. They do |
| 378 | * not reflect the actual power state of the device or its status as seen by the |
| 379 | * driver. |
| 380 | * |
| 381 | * RPM_ACTIVE Device is fully operational. Indicates that the device |
| 382 | * bus type's ->runtime_resume() callback has completed |
| 383 | * successfully. |
| 384 | * |
| 385 | * RPM_SUSPENDED Device bus type's ->runtime_suspend() callback has |
| 386 | * completed successfully. The device is regarded as |
| 387 | * suspended. |
| 388 | * |
| 389 | * RPM_RESUMING Device bus type's ->runtime_resume() callback is being |
| 390 | * executed. |
| 391 | * |
| 392 | * RPM_SUSPENDING Device bus type's ->runtime_suspend() callback is being |
| 393 | * executed. |
| 394 | */ |
| 395 | |
| 396 | enum rpm_status { |
| 397 | RPM_ACTIVE = 0, |
| 398 | RPM_RESUMING, |
| 399 | RPM_SUSPENDED, |
| 400 | RPM_SUSPENDING, |
| 401 | }; |
| 402 | |
| 403 | /** |
| 404 | * Device run-time power management request types. |
| 405 | * |
| 406 | * RPM_REQ_NONE Do nothing. |
| 407 | * |
| 408 | * RPM_REQ_IDLE Run the device bus type's ->runtime_idle() callback |
| 409 | * |
| 410 | * RPM_REQ_SUSPEND Run the device bus type's ->runtime_suspend() callback |
| 411 | * |
Alan Stern | 15bcb91d | 2010-09-25 23:35:21 +0200 | [diff] [blame] | 412 | * RPM_REQ_AUTOSUSPEND Same as RPM_REQ_SUSPEND, but not until the device has |
| 413 | * been inactive for as long as power.autosuspend_delay |
| 414 | * |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 415 | * RPM_REQ_RESUME Run the device bus type's ->runtime_resume() callback |
| 416 | */ |
| 417 | |
| 418 | enum rpm_request { |
| 419 | RPM_REQ_NONE = 0, |
| 420 | RPM_REQ_IDLE, |
| 421 | RPM_REQ_SUSPEND, |
Alan Stern | 15bcb91d | 2010-09-25 23:35:21 +0200 | [diff] [blame] | 422 | RPM_REQ_AUTOSUSPEND, |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 423 | RPM_REQ_RESUME, |
| 424 | }; |
| 425 | |
Rafael J. Wysocki | 074037e | 2010-09-22 22:09:10 +0200 | [diff] [blame] | 426 | struct wakeup_source; |
| 427 | |
Rafael J. Wysocki | 4605ab6 | 2011-08-25 15:34:12 +0200 | [diff] [blame] | 428 | struct pm_domain_data { |
| 429 | struct list_head list_node; |
| 430 | struct device *dev; |
Rafael J. Wysocki | 4605ab6 | 2011-08-25 15:34:12 +0200 | [diff] [blame] | 431 | }; |
| 432 | |
Rafael J. Wysocki | 5c095a0 | 2011-08-25 15:33:50 +0200 | [diff] [blame] | 433 | struct pm_subsys_data { |
| 434 | spinlock_t lock; |
Rafael J. Wysocki | ef27bed | 2011-08-25 15:34:01 +0200 | [diff] [blame] | 435 | unsigned int refcount; |
Rafael J. Wysocki | 5c095a0 | 2011-08-25 15:33:50 +0200 | [diff] [blame] | 436 | #ifdef CONFIG_PM_CLK |
| 437 | struct list_head clock_list; |
| 438 | #endif |
Rafael J. Wysocki | 4605ab6 | 2011-08-25 15:34:12 +0200 | [diff] [blame] | 439 | #ifdef CONFIG_PM_GENERIC_DOMAINS |
Rafael J. Wysocki | cd0ea67 | 2011-09-26 20:22:02 +0200 | [diff] [blame] | 440 | struct pm_domain_data *domain_data; |
Rafael J. Wysocki | 4605ab6 | 2011-08-25 15:34:12 +0200 | [diff] [blame] | 441 | #endif |
Rafael J. Wysocki | 5c095a0 | 2011-08-25 15:33:50 +0200 | [diff] [blame] | 442 | }; |
| 443 | |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 444 | struct dev_pm_info { |
| 445 | pm_message_t power_state; |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 446 | unsigned int can_wakeup:1; |
Rafael J. Wysocki | b8c76f6 | 2010-12-16 00:51:21 +0100 | [diff] [blame] | 447 | unsigned int async_suspend:1; |
Alan Stern | f76b168b | 2011-06-18 20:22:23 +0200 | [diff] [blame] | 448 | bool is_prepared:1; /* Owned by the PM core */ |
Alan Stern | 6d0e0e8 | 2011-06-18 22:42:09 +0200 | [diff] [blame] | 449 | bool is_suspended:1; /* Ditto */ |
Rafael J. Wysocki | 074037e | 2010-09-22 22:09:10 +0200 | [diff] [blame] | 450 | spinlock_t lock; |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 451 | #ifdef CONFIG_PM_SLEEP |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 452 | struct list_head entry; |
Rafael J. Wysocki | 5af84b8 | 2010-01-23 22:23:32 +0100 | [diff] [blame] | 453 | struct completion completion; |
Rafael J. Wysocki | 074037e | 2010-09-22 22:09:10 +0200 | [diff] [blame] | 454 | struct wakeup_source *wakeup; |
Rafael J. Wysocki | 4ca46ff | 2011-10-16 23:34:36 +0200 | [diff] [blame] | 455 | bool wakeup_path:1; |
Rafael J. Wysocki | 805bdae | 2011-02-24 11:10:01 +0100 | [diff] [blame] | 456 | #else |
| 457 | unsigned int should_wakeup:1; |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 458 | #endif |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 459 | #ifdef CONFIG_PM_RUNTIME |
| 460 | struct timer_list suspend_timer; |
| 461 | unsigned long timer_expires; |
| 462 | struct work_struct work; |
| 463 | wait_queue_head_t wait_queue; |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 464 | atomic_t usage_count; |
| 465 | atomic_t child_count; |
| 466 | unsigned int disable_depth:3; |
| 467 | unsigned int ignore_children:1; |
| 468 | unsigned int idle_notification:1; |
| 469 | unsigned int request_pending:1; |
| 470 | unsigned int deferred_resume:1; |
Rafael J. Wysocki | 7a1a8eb | 2009-12-03 21:19:18 +0100 | [diff] [blame] | 471 | unsigned int run_wake:1; |
Rafael J. Wysocki | 5382363 | 2010-01-23 22:02:51 +0100 | [diff] [blame] | 472 | unsigned int runtime_auto:1; |
Alan Stern | 7490e44 | 2010-09-25 23:35:15 +0200 | [diff] [blame] | 473 | unsigned int no_callbacks:1; |
Alan Stern | c7b61de | 2010-12-01 00:14:42 +0100 | [diff] [blame] | 474 | unsigned int irq_safe:1; |
Alan Stern | 15bcb91d | 2010-09-25 23:35:21 +0200 | [diff] [blame] | 475 | unsigned int use_autosuspend:1; |
| 476 | unsigned int timer_autosuspends:1; |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 477 | enum rpm_request request; |
| 478 | enum rpm_status runtime_status; |
| 479 | int runtime_error; |
Alan Stern | 15bcb91d | 2010-09-25 23:35:21 +0200 | [diff] [blame] | 480 | int autosuspend_delay; |
| 481 | unsigned long last_busy; |
Arjan van de Ven | 8d4b9d1 | 2010-07-19 02:01:06 +0200 | [diff] [blame] | 482 | unsigned long active_jiffies; |
| 483 | unsigned long suspended_jiffies; |
| 484 | unsigned long accounting_timestamp; |
Rafael J. Wysocki | 5e928f7 | 2009-08-18 23:38:32 +0200 | [diff] [blame] | 485 | #endif |
Rafael J. Wysocki | 5c095a0 | 2011-08-25 15:33:50 +0200 | [diff] [blame] | 486 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ |
Jean Pihet | 91ff4cb | 2011-08-25 15:35:41 +0200 | [diff] [blame] | 487 | struct pm_qos_constraints *constraints; |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 488 | }; |
| 489 | |
Arjan van de Ven | 8d4b9d1 | 2010-07-19 02:01:06 +0200 | [diff] [blame] | 490 | extern void update_pm_runtime_accounting(struct device *dev); |
Rafael J. Wysocki | ef27bed | 2011-08-25 15:34:01 +0200 | [diff] [blame] | 491 | extern int dev_pm_get_subsys_data(struct device *dev); |
| 492 | extern int dev_pm_put_subsys_data(struct device *dev); |
Arjan van de Ven | 8d4b9d1 | 2010-07-19 02:01:06 +0200 | [diff] [blame] | 493 | |
Rafael J. Wysocki | 7538e3d | 2011-02-16 21:53:17 +0100 | [diff] [blame] | 494 | /* |
| 495 | * Power domains provide callbacks that are executed during system suspend, |
| 496 | * hibernation, system resume and during runtime PM transitions along with |
| 497 | * subsystem-level and driver-level callbacks. |
| 498 | */ |
Rafael J. Wysocki | 564b905 | 2011-06-23 01:52:55 +0200 | [diff] [blame] | 499 | struct dev_pm_domain { |
Rafael J. Wysocki | 7538e3d | 2011-02-16 21:53:17 +0100 | [diff] [blame] | 500 | struct dev_pm_ops ops; |
| 501 | }; |
Arjan van de Ven | 8d4b9d1 | 2010-07-19 02:01:06 +0200 | [diff] [blame] | 502 | |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 503 | /* |
| 504 | * The PM_EVENT_ messages are also used by drivers implementing the legacy |
| 505 | * suspend framework, based on the ->suspend() and ->resume() callbacks common |
| 506 | * for suspend and hibernation transitions, according to the rules below. |
| 507 | */ |
| 508 | |
| 509 | /* Necessary, because several drivers use PM_EVENT_PRETHAW */ |
| 510 | #define PM_EVENT_PRETHAW PM_EVENT_QUIESCE |
| 511 | |
| 512 | /* |
David Brownell | 82bb67f | 2006-08-14 23:11:04 -0700 | [diff] [blame] | 513 | * One transition is triggered by resume(), after a suspend() call; the |
| 514 | * message is implicit: |
| 515 | * |
| 516 | * ON Driver starts working again, responding to hardware events |
| 517 | * and software requests. The hardware may have gone through |
| 518 | * a power-off reset, or it may have maintained state from the |
| 519 | * previous suspend() which the driver will rely on while |
| 520 | * resuming. On most platforms, there are no restrictions on |
| 521 | * availability of resources like clocks during resume(). |
| 522 | * |
| 523 | * Other transitions are triggered by messages sent using suspend(). All |
| 524 | * these transitions quiesce the driver, so that I/O queues are inactive. |
| 525 | * That commonly entails turning off IRQs and DMA; there may be rules |
| 526 | * about how to quiesce that are specific to the bus or the device's type. |
| 527 | * (For example, network drivers mark the link state.) Other details may |
| 528 | * differ according to the message: |
| 529 | * |
| 530 | * SUSPEND Quiesce, enter a low power device state appropriate for |
| 531 | * the upcoming system state (such as PCI_D3hot), and enable |
| 532 | * wakeup events as appropriate. |
| 533 | * |
Rafael J. Wysocki | 3a2d5b7 | 2008-02-23 19:13:25 +0100 | [diff] [blame] | 534 | * HIBERNATE Enter a low power device state appropriate for the hibernation |
| 535 | * state (eg. ACPI S4) and enable wakeup events as appropriate. |
| 536 | * |
David Brownell | 82bb67f | 2006-08-14 23:11:04 -0700 | [diff] [blame] | 537 | * FREEZE Quiesce operations so that a consistent image can be saved; |
| 538 | * but do NOT otherwise enter a low power device state, and do |
| 539 | * NOT emit system wakeup events. |
| 540 | * |
| 541 | * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring |
| 542 | * the system from a snapshot taken after an earlier FREEZE. |
| 543 | * Some drivers will need to reset their hardware state instead |
| 544 | * of preserving it, to ensure that it's never mistaken for the |
| 545 | * state which that earlier snapshot had set up. |
| 546 | * |
| 547 | * A minimally power-aware driver treats all messages as SUSPEND, fully |
| 548 | * reinitializes its device during resume() -- whether or not it was reset |
| 549 | * during the suspend/resume cycle -- and can't issue wakeup events. |
| 550 | * |
| 551 | * More power-aware drivers may also use low power states at runtime as |
| 552 | * well as during system sleep states like PM_SUSPEND_STANDBY. They may |
| 553 | * be able to use wakeup events to exit from runtime low-power states, |
| 554 | * or from system low-power states such as standby or suspend-to-RAM. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 555 | */ |
| 556 | |
Rafael J. Wysocki | 296699d | 2007-07-29 23:27:18 +0200 | [diff] [blame] | 557 | #ifdef CONFIG_PM_SLEEP |
Rafael J. Wysocki | d47d81c | 2011-03-23 22:16:41 +0100 | [diff] [blame] | 558 | extern void device_pm_lock(void); |
Alan Stern | d161630 | 2009-05-24 22:05:42 +0200 | [diff] [blame] | 559 | extern void dpm_resume_noirq(pm_message_t state); |
| 560 | extern void dpm_resume_end(pm_message_t state); |
Rafael J. Wysocki | 91e7c75 | 2011-05-17 23:26:00 +0200 | [diff] [blame] | 561 | extern void dpm_resume(pm_message_t state); |
| 562 | extern void dpm_complete(pm_message_t state); |
Rafael J. Wysocki | 1eede07 | 2008-05-20 23:00:01 +0200 | [diff] [blame] | 563 | |
| 564 | extern void device_pm_unlock(void); |
Alan Stern | d161630 | 2009-05-24 22:05:42 +0200 | [diff] [blame] | 565 | extern int dpm_suspend_noirq(pm_message_t state); |
| 566 | extern int dpm_suspend_start(pm_message_t state); |
Rafael J. Wysocki | 91e7c75 | 2011-05-17 23:26:00 +0200 | [diff] [blame] | 567 | extern int dpm_suspend(pm_message_t state); |
| 568 | extern int dpm_prepare(pm_message_t state); |
David Brownell | 0ac8524 | 2005-09-12 19:39:34 -0700 | [diff] [blame] | 569 | |
Andrew Morton | 0266949 | 2006-03-23 01:38:34 -0800 | [diff] [blame] | 570 | extern void __suspend_report_result(const char *function, void *fn, int ret); |
| 571 | |
| 572 | #define suspend_report_result(fn, ret) \ |
| 573 | do { \ |
Harvey Harrison | d5c003b | 2008-10-15 22:01:24 -0700 | [diff] [blame] | 574 | __suspend_report_result(__func__, fn, ret); \ |
Andrew Morton | 0266949 | 2006-03-23 01:38:34 -0800 | [diff] [blame] | 575 | } while (0) |
Andrew Morton | 9a7834d | 2005-10-23 23:02:20 -0700 | [diff] [blame] | 576 | |
Rafael J. Wysocki | 098dff7 | 2010-09-22 22:10:57 +0200 | [diff] [blame] | 577 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); |
Rafael J. Wysocki | 6538df8 | 2011-05-17 23:26:21 +0200 | [diff] [blame] | 578 | |
| 579 | extern int pm_generic_prepare(struct device *dev); |
Rafael J. Wysocki | e529192 | 2011-07-01 22:12:59 +0200 | [diff] [blame] | 580 | extern int pm_generic_suspend_noirq(struct device *dev); |
Rafael J. Wysocki | 6538df8 | 2011-05-17 23:26:21 +0200 | [diff] [blame] | 581 | extern int pm_generic_suspend(struct device *dev); |
Rafael J. Wysocki | e529192 | 2011-07-01 22:12:59 +0200 | [diff] [blame] | 582 | extern int pm_generic_resume_noirq(struct device *dev); |
Rafael J. Wysocki | 6538df8 | 2011-05-17 23:26:21 +0200 | [diff] [blame] | 583 | extern int pm_generic_resume(struct device *dev); |
Rafael J. Wysocki | e529192 | 2011-07-01 22:12:59 +0200 | [diff] [blame] | 584 | extern int pm_generic_freeze_noirq(struct device *dev); |
Rafael J. Wysocki | 6538df8 | 2011-05-17 23:26:21 +0200 | [diff] [blame] | 585 | extern int pm_generic_freeze(struct device *dev); |
Rafael J. Wysocki | e529192 | 2011-07-01 22:12:59 +0200 | [diff] [blame] | 586 | extern int pm_generic_thaw_noirq(struct device *dev); |
Rafael J. Wysocki | 6538df8 | 2011-05-17 23:26:21 +0200 | [diff] [blame] | 587 | extern int pm_generic_thaw(struct device *dev); |
Rafael J. Wysocki | e529192 | 2011-07-01 22:12:59 +0200 | [diff] [blame] | 588 | extern int pm_generic_restore_noirq(struct device *dev); |
Rafael J. Wysocki | 6538df8 | 2011-05-17 23:26:21 +0200 | [diff] [blame] | 589 | extern int pm_generic_restore(struct device *dev); |
Rafael J. Wysocki | e529192 | 2011-07-01 22:12:59 +0200 | [diff] [blame] | 590 | extern int pm_generic_poweroff_noirq(struct device *dev); |
Rafael J. Wysocki | 6538df8 | 2011-05-17 23:26:21 +0200 | [diff] [blame] | 591 | extern int pm_generic_poweroff(struct device *dev); |
| 592 | extern void pm_generic_complete(struct device *dev); |
| 593 | |
Alan Stern | d288e47 | 2008-03-19 22:37:42 +0100 | [diff] [blame] | 594 | #else /* !CONFIG_PM_SLEEP */ |
| 595 | |
Cornelia Huck | ffa6a70 | 2009-03-04 12:44:00 +0100 | [diff] [blame] | 596 | #define device_pm_lock() do {} while (0) |
| 597 | #define device_pm_unlock() do {} while (0) |
| 598 | |
Alan Stern | d161630 | 2009-05-24 22:05:42 +0200 | [diff] [blame] | 599 | static inline int dpm_suspend_start(pm_message_t state) |
Alan Stern | d288e47 | 2008-03-19 22:37:42 +0100 | [diff] [blame] | 600 | { |
| 601 | return 0; |
| 602 | } |
| 603 | |
Alan Stern | 9a3df1f | 2008-03-19 22:39:13 +0100 | [diff] [blame] | 604 | #define suspend_report_result(fn, ret) do {} while (0) |
Alan Stern | d288e47 | 2008-03-19 22:37:42 +0100 | [diff] [blame] | 605 | |
Rafael J. Wysocki | 098dff7 | 2010-09-22 22:10:57 +0200 | [diff] [blame] | 606 | static inline int device_pm_wait_for_dev(struct device *a, struct device *b) |
| 607 | { |
| 608 | return 0; |
| 609 | } |
Rafael J. Wysocki | 6538df8 | 2011-05-17 23:26:21 +0200 | [diff] [blame] | 610 | |
| 611 | #define pm_generic_prepare NULL |
| 612 | #define pm_generic_suspend NULL |
| 613 | #define pm_generic_resume NULL |
| 614 | #define pm_generic_freeze NULL |
| 615 | #define pm_generic_thaw NULL |
| 616 | #define pm_generic_restore NULL |
| 617 | #define pm_generic_poweroff NULL |
| 618 | #define pm_generic_complete NULL |
Alan Stern | d288e47 | 2008-03-19 22:37:42 +0100 | [diff] [blame] | 619 | #endif /* !CONFIG_PM_SLEEP */ |
| 620 | |
Cornelia Huck | ffa6a70 | 2009-03-04 12:44:00 +0100 | [diff] [blame] | 621 | /* How to reorder dpm_list after device_move() */ |
| 622 | enum dpm_order { |
| 623 | DPM_ORDER_NONE, |
| 624 | DPM_ORDER_DEV_AFTER_PARENT, |
| 625 | DPM_ORDER_PARENT_BEFORE_DEV, |
| 626 | DPM_ORDER_DEV_LAST, |
| 627 | }; |
| 628 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 629 | #endif /* _LINUX_PM_H */ |