pm.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  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. #ifndef _LINUX_PM_H
  21. #define _LINUX_PM_H
  22. #include <linux/list.h>
  23. #include <linux/workqueue.h>
  24. #include <linux/spinlock.h>
  25. #include <linux/wait.h>
  26. #include <linux/timer.h>
  27. /*
  28. * Callbacks for platform drivers to implement.
  29. */
  30. extern void (*pm_idle)(void);
  31. extern void (*pm_power_off)(void);
  32. extern void (*pm_power_off_prepare)(void);
  33. /*
  34. * Device power management
  35. */
  36. struct device;
  37. typedef struct pm_message {
  38. int event;
  39. } pm_message_t;
  40. /**
  41. * struct dev_pm_ops - device PM callbacks
  42. *
  43. * Several driver power state transitions are externally visible, affecting
  44. * the state of pending I/O queues and (for drivers that touch hardware)
  45. * interrupts, wakeups, DMA, and other hardware state. There may also be
  46. * internal transitions to various low power modes, which are transparent
  47. * to the rest of the driver stack (such as a driver that's ON gating off
  48. * clocks which are not in active use).
  49. *
  50. * The externally visible transitions are handled with the help of the following
  51. * callbacks included in this structure:
  52. *
  53. * @prepare: Prepare the device for the upcoming transition, but do NOT change
  54. * its hardware state. Prevent new children of the device from being
  55. * registered after @prepare() returns (the driver's subsystem and
  56. * generally the rest of the kernel is supposed to prevent new calls to the
  57. * probe method from being made too once @prepare() has succeeded). If
  58. * @prepare() detects a situation it cannot handle (e.g. registration of a
  59. * child already in progress), it may return -EAGAIN, so that the PM core
  60. * can execute it once again (e.g. after the new child has been registered)
  61. * to recover from the race condition. This method is executed for all
  62. * kinds of suspend transitions and is followed by one of the suspend
  63. * callbacks: @suspend(), @freeze(), or @poweroff().
  64. * The PM core executes @prepare() for all devices before starting to
  65. * execute suspend callbacks for any of them, so drivers may assume all of
  66. * the other devices to be present and functional while @prepare() is being
  67. * executed. In particular, it is safe to make GFP_KERNEL memory
  68. * allocations from within @prepare(). However, drivers may NOT assume
  69. * anything about the availability of the user space at that time and it
  70. * is not correct to request firmware from within @prepare() (it's too
  71. * late to do that). [To work around this limitation, drivers may
  72. * register suspend and hibernation notifiers that are executed before the
  73. * freezing of tasks.]
  74. *
  75. * @complete: Undo the changes made by @prepare(). This method is executed for
  76. * all kinds of resume transitions, following one of the resume callbacks:
  77. * @resume(), @thaw(), @restore(). Also called if the state transition
  78. * fails before the driver's suspend callback (@suspend(), @freeze(),
  79. * @poweroff()) can be executed (e.g. if the suspend callback fails for one
  80. * of the other devices that the PM core has unsuccessfully attempted to
  81. * suspend earlier).
  82. * The PM core executes @complete() after it has executed the appropriate
  83. * resume callback for all devices.
  84. *
  85. * @suspend: Executed before putting the system into a sleep state in which the
  86. * contents of main memory are preserved. Quiesce the device, put it into
  87. * a low power state appropriate for the upcoming system state (such as
  88. * PCI_D3hot), and enable wakeup events as appropriate.
  89. *
  90. * @resume: Executed after waking the system up from a sleep state in which the
  91. * contents of main memory were preserved. Put the device into the
  92. * appropriate state, according to the information saved in memory by the
  93. * preceding @suspend(). The driver starts working again, responding to
  94. * hardware events and software requests. The hardware may have gone
  95. * through a power-off reset, or it may have maintained state from the
  96. * previous suspend() which the driver may rely on while resuming. On most
  97. * platforms, there are no restrictions on availability of resources like
  98. * clocks during @resume().
  99. *
  100. * @freeze: Hibernation-specific, executed before creating a hibernation image.
  101. * Quiesce operations so that a consistent image can be created, but do NOT
  102. * otherwise put the device into a low power device state and do NOT emit
  103. * system wakeup events. Save in main memory the device settings to be
  104. * used by @restore() during the subsequent resume from hibernation or by
  105. * the subsequent @thaw(), if the creation of the image or the restoration
  106. * of main memory contents from it fails.
  107. *
  108. * @thaw: Hibernation-specific, executed after creating a hibernation image OR
  109. * if the creation of the image fails. Also executed after a failing
  110. * attempt to restore the contents of main memory from such an image.
  111. * Undo the changes made by the preceding @freeze(), so the device can be
  112. * operated in the same way as immediately before the call to @freeze().
  113. *
  114. * @poweroff: Hibernation-specific, executed after saving a hibernation image.
  115. * Quiesce the device, put it into a low power state appropriate for the
  116. * upcoming system state (such as PCI_D3hot), and enable wakeup events as
  117. * appropriate.
  118. *
  119. * @restore: Hibernation-specific, executed after restoring the contents of main
  120. * memory from a hibernation image. Driver starts working again,
  121. * responding to hardware events and software requests. Drivers may NOT
  122. * make ANY assumptions about the hardware state right prior to @restore().
  123. * On most platforms, there are no restrictions on availability of
  124. * resources like clocks during @restore().
  125. *
  126. * @suspend_noirq: Complete the operations of ->suspend() by carrying out any
  127. * actions required for suspending the device that need interrupts to be
  128. * disabled
  129. *
  130. * @resume_noirq: Prepare for the execution of ->resume() by carrying out any
  131. * actions required for resuming the device that need interrupts to be
  132. * disabled
  133. *
  134. * @freeze_noirq: Complete the operations of ->freeze() by carrying out any
  135. * actions required for freezing the device that need interrupts to be
  136. * disabled
  137. *
  138. * @thaw_noirq: Prepare for the execution of ->thaw() by carrying out any
  139. * actions required for thawing the device that need interrupts to be
  140. * disabled
  141. *
  142. * @poweroff_noirq: Complete the operations of ->poweroff() by carrying out any
  143. * actions required for handling the device that need interrupts to be
  144. * disabled
  145. *
  146. * @restore_noirq: Prepare for the execution of ->restore() by carrying out any
  147. * actions required for restoring the operations of the device that need
  148. * interrupts to be disabled
  149. *
  150. * All of the above callbacks, except for @complete(), return error codes.
  151. * However, the error codes returned by the resume operations, @resume(),
  152. * @thaw(), @restore(), @resume_noirq(), @thaw_noirq(), and @restore_noirq() do
  153. * not cause the PM core to abort the resume transition during which they are
  154. * returned. The error codes returned in that cases are only printed by the PM
  155. * core to the system logs for debugging purposes. Still, it is recommended
  156. * that drivers only return error codes from their resume methods in case of an
  157. * unrecoverable failure (i.e. when the device being handled refuses to resume
  158. * and becomes unusable) to allow us to modify the PM core in the future, so
  159. * that it can avoid attempting to handle devices that failed to resume and
  160. * their children.
  161. *
  162. * It is allowed to unregister devices while the above callbacks are being
  163. * executed. However, it is not allowed to unregister a device from within any
  164. * of its own callbacks.
  165. *
  166. * There also are the following callbacks related to run-time power management
  167. * of devices:
  168. *
  169. * @runtime_suspend: Prepare the device for a condition in which it won't be
  170. * able to communicate with the CPU(s) and RAM due to power management.
  171. * This need not mean that the device should be put into a low power state.
  172. * For example, if the device is behind a link which is about to be turned
  173. * off, the device may remain at full power. If the device does go to low
  174. * power and is capable of generating run-time wake-up events, remote
  175. * wake-up (i.e., a hardware mechanism allowing the device to request a
  176. * change of its power state via a wake-up event, such as PCI PME) should
  177. * be enabled for it.
  178. *
  179. * @runtime_resume: Put the device into the fully active state in response to a
  180. * wake-up event generated by hardware or at the request of software. If
  181. * necessary, put the device into the full power state and restore its
  182. * registers, so that it is fully operational.
  183. *
  184. * @runtime_idle: Device appears to be inactive and it might be put into a low
  185. * power state if all of the necessary conditions are satisfied. Check
  186. * these conditions and handle the device as appropriate, possibly queueing
  187. * a suspend request for it. The return value is ignored by the PM core.
  188. */
  189. struct dev_pm_ops {
  190. int (*prepare)(struct device *dev);
  191. void (*complete)(struct device *dev);
  192. int (*suspend)(struct device *dev);
  193. int (*resume)(struct device *dev);
  194. int (*freeze)(struct device *dev);
  195. int (*thaw)(struct device *dev);
  196. int (*poweroff)(struct device *dev);
  197. int (*restore)(struct device *dev);
  198. int (*suspend_noirq)(struct device *dev);
  199. int (*resume_noirq)(struct device *dev);
  200. int (*freeze_noirq)(struct device *dev);
  201. int (*thaw_noirq)(struct device *dev);
  202. int (*poweroff_noirq)(struct device *dev);
  203. int (*restore_noirq)(struct device *dev);
  204. int (*runtime_suspend)(struct device *dev);
  205. int (*runtime_resume)(struct device *dev);
  206. int (*runtime_idle)(struct device *dev);
  207. };
  208. /*
  209. * Use this if you want to use the same suspend and resume callbacks for suspend
  210. * to RAM and hibernation.
  211. */
  212. #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
  213. const struct dev_pm_ops name = { \
  214. .suspend = suspend_fn, \
  215. .resume = resume_fn, \
  216. .freeze = suspend_fn, \
  217. .thaw = resume_fn, \
  218. .poweroff = suspend_fn, \
  219. .restore = resume_fn, \
  220. }
  221. /**
  222. * PM_EVENT_ messages
  223. *
  224. * The following PM_EVENT_ messages are defined for the internal use of the PM
  225. * core, in order to provide a mechanism allowing the high level suspend and
  226. * hibernation code to convey the necessary information to the device PM core
  227. * code:
  228. *
  229. * ON No transition.
  230. *
  231. * FREEZE System is going to hibernate, call ->prepare() and ->freeze()
  232. * for all devices.
  233. *
  234. * SUSPEND System is going to suspend, call ->prepare() and ->suspend()
  235. * for all devices.
  236. *
  237. * HIBERNATE Hibernation image has been saved, call ->prepare() and
  238. * ->poweroff() for all devices.
  239. *
  240. * QUIESCE Contents of main memory are going to be restored from a (loaded)
  241. * hibernation image, call ->prepare() and ->freeze() for all
  242. * devices.
  243. *
  244. * RESUME System is resuming, call ->resume() and ->complete() for all
  245. * devices.
  246. *
  247. * THAW Hibernation image has been created, call ->thaw() and
  248. * ->complete() for all devices.
  249. *
  250. * RESTORE Contents of main memory have been restored from a hibernation
  251. * image, call ->restore() and ->complete() for all devices.
  252. *
  253. * RECOVER Creation of a hibernation image or restoration of the main
  254. * memory contents from a hibernation image has failed, call
  255. * ->thaw() and ->complete() for all devices.
  256. *
  257. * The following PM_EVENT_ messages are defined for internal use by
  258. * kernel subsystems. They are never issued by the PM core.
  259. *
  260. * USER_SUSPEND Manual selective suspend was issued by userspace.
  261. *
  262. * USER_RESUME Manual selective resume was issued by userspace.
  263. *
  264. * REMOTE_WAKEUP Remote-wakeup request was received from the device.
  265. *
  266. * AUTO_SUSPEND Automatic (device idle) runtime suspend was
  267. * initiated by the subsystem.
  268. *
  269. * AUTO_RESUME Automatic (device needed) runtime resume was
  270. * requested by a driver.
  271. */
  272. #define PM_EVENT_ON 0x0000
  273. #define PM_EVENT_FREEZE 0x0001
  274. #define PM_EVENT_SUSPEND 0x0002
  275. #define PM_EVENT_HIBERNATE 0x0004
  276. #define PM_EVENT_QUIESCE 0x0008
  277. #define PM_EVENT_RESUME 0x0010
  278. #define PM_EVENT_THAW 0x0020
  279. #define PM_EVENT_RESTORE 0x0040
  280. #define PM_EVENT_RECOVER 0x0080
  281. #define PM_EVENT_USER 0x0100
  282. #define PM_EVENT_REMOTE 0x0200
  283. #define PM_EVENT_AUTO 0x0400
  284. #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE)
  285. #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND)
  286. #define PM_EVENT_USER_RESUME (PM_EVENT_USER | PM_EVENT_RESUME)
  287. #define PM_EVENT_REMOTE_RESUME (PM_EVENT_REMOTE | PM_EVENT_RESUME)
  288. #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND)
  289. #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME)
  290. #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
  291. #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
  292. #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, })
  293. #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, })
  294. #define PMSG_HIBERNATE ((struct pm_message){ .event = PM_EVENT_HIBERNATE, })
  295. #define PMSG_RESUME ((struct pm_message){ .event = PM_EVENT_RESUME, })
  296. #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, })
  297. #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, })
  298. #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, })
  299. #define PMSG_USER_SUSPEND ((struct pm_message) \
  300. { .event = PM_EVENT_USER_SUSPEND, })
  301. #define PMSG_USER_RESUME ((struct pm_message) \
  302. { .event = PM_EVENT_USER_RESUME, })
  303. #define PMSG_REMOTE_RESUME ((struct pm_message) \
  304. { .event = PM_EVENT_REMOTE_RESUME, })
  305. #define PMSG_AUTO_SUSPEND ((struct pm_message) \
  306. { .event = PM_EVENT_AUTO_SUSPEND, })
  307. #define PMSG_AUTO_RESUME ((struct pm_message) \
  308. { .event = PM_EVENT_AUTO_RESUME, })
  309. /**
  310. * Device power management states
  311. *
  312. * These state labels are used internally by the PM core to indicate the current
  313. * status of a device with respect to the PM core operations.
  314. *
  315. * DPM_ON Device is regarded as operational. Set this way
  316. * initially and when ->complete() is about to be called.
  317. * Also set when ->prepare() fails.
  318. *
  319. * DPM_PREPARING Device is going to be prepared for a PM transition. Set
  320. * when ->prepare() is about to be called.
  321. *
  322. * DPM_RESUMING Device is going to be resumed. Set when ->resume(),
  323. * ->thaw(), or ->restore() is about to be called.
  324. *
  325. * DPM_SUSPENDING Device has been prepared for a power transition. Set
  326. * when ->prepare() has just succeeded.
  327. *
  328. * DPM_OFF Device is regarded as inactive. Set immediately after
  329. * ->suspend(), ->freeze(), or ->poweroff() has succeeded.
  330. * Also set when ->resume()_noirq, ->thaw_noirq(), or
  331. * ->restore_noirq() is about to be called.
  332. *
  333. * DPM_OFF_IRQ Device is in a "deep sleep". Set immediately after
  334. * ->suspend_noirq(), ->freeze_noirq(), or
  335. * ->poweroff_noirq() has just succeeded.
  336. */
  337. enum dpm_state {
  338. DPM_INVALID,
  339. DPM_ON,
  340. DPM_PREPARING,
  341. DPM_RESUMING,
  342. DPM_SUSPENDING,
  343. DPM_OFF,
  344. DPM_OFF_IRQ,
  345. };
  346. /**
  347. * Device run-time power management status.
  348. *
  349. * These status labels are used internally by the PM core to indicate the
  350. * current status of a device with respect to the PM core operations. They do
  351. * not reflect the actual power state of the device or its status as seen by the
  352. * driver.
  353. *
  354. * RPM_ACTIVE Device is fully operational. Indicates that the device
  355. * bus type's ->runtime_resume() callback has completed
  356. * successfully.
  357. *
  358. * RPM_SUSPENDED Device bus type's ->runtime_suspend() callback has
  359. * completed successfully. The device is regarded as
  360. * suspended.
  361. *
  362. * RPM_RESUMING Device bus type's ->runtime_resume() callback is being
  363. * executed.
  364. *
  365. * RPM_SUSPENDING Device bus type's ->runtime_suspend() callback is being
  366. * executed.
  367. */
  368. enum rpm_status {
  369. RPM_ACTIVE = 0,
  370. RPM_RESUMING,
  371. RPM_SUSPENDED,
  372. RPM_SUSPENDING,
  373. };
  374. /**
  375. * Device run-time power management request types.
  376. *
  377. * RPM_REQ_NONE Do nothing.
  378. *
  379. * RPM_REQ_IDLE Run the device bus type's ->runtime_idle() callback
  380. *
  381. * RPM_REQ_SUSPEND Run the device bus type's ->runtime_suspend() callback
  382. *
  383. * RPM_REQ_RESUME Run the device bus type's ->runtime_resume() callback
  384. */
  385. enum rpm_request {
  386. RPM_REQ_NONE = 0,
  387. RPM_REQ_IDLE,
  388. RPM_REQ_SUSPEND,
  389. RPM_REQ_RESUME,
  390. };
  391. struct dev_pm_info {
  392. pm_message_t power_state;
  393. unsigned int can_wakeup:1;
  394. unsigned int should_wakeup:1;
  395. enum dpm_state status; /* Owned by the PM core */
  396. #ifdef CONFIG_PM_SLEEP
  397. struct list_head entry;
  398. #endif
  399. #ifdef CONFIG_PM_RUNTIME
  400. struct timer_list suspend_timer;
  401. unsigned long timer_expires;
  402. struct work_struct work;
  403. wait_queue_head_t wait_queue;
  404. spinlock_t lock;
  405. atomic_t usage_count;
  406. atomic_t child_count;
  407. unsigned int disable_depth:3;
  408. unsigned int ignore_children:1;
  409. unsigned int idle_notification:1;
  410. unsigned int request_pending:1;
  411. unsigned int deferred_resume:1;
  412. unsigned int run_wake:1;
  413. unsigned int runtime_auto:1;
  414. enum rpm_request request;
  415. enum rpm_status runtime_status;
  416. int runtime_error;
  417. #endif
  418. };
  419. /*
  420. * The PM_EVENT_ messages are also used by drivers implementing the legacy
  421. * suspend framework, based on the ->suspend() and ->resume() callbacks common
  422. * for suspend and hibernation transitions, according to the rules below.
  423. */
  424. /* Necessary, because several drivers use PM_EVENT_PRETHAW */
  425. #define PM_EVENT_PRETHAW PM_EVENT_QUIESCE
  426. /*
  427. * One transition is triggered by resume(), after a suspend() call; the
  428. * message is implicit:
  429. *
  430. * ON Driver starts working again, responding to hardware events
  431. * and software requests. The hardware may have gone through
  432. * a power-off reset, or it may have maintained state from the
  433. * previous suspend() which the driver will rely on while
  434. * resuming. On most platforms, there are no restrictions on
  435. * availability of resources like clocks during resume().
  436. *
  437. * Other transitions are triggered by messages sent using suspend(). All
  438. * these transitions quiesce the driver, so that I/O queues are inactive.
  439. * That commonly entails turning off IRQs and DMA; there may be rules
  440. * about how to quiesce that are specific to the bus or the device's type.
  441. * (For example, network drivers mark the link state.) Other details may
  442. * differ according to the message:
  443. *
  444. * SUSPEND Quiesce, enter a low power device state appropriate for
  445. * the upcoming system state (such as PCI_D3hot), and enable
  446. * wakeup events as appropriate.
  447. *
  448. * HIBERNATE Enter a low power device state appropriate for the hibernation
  449. * state (eg. ACPI S4) and enable wakeup events as appropriate.
  450. *
  451. * FREEZE Quiesce operations so that a consistent image can be saved;
  452. * but do NOT otherwise enter a low power device state, and do
  453. * NOT emit system wakeup events.
  454. *
  455. * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring
  456. * the system from a snapshot taken after an earlier FREEZE.
  457. * Some drivers will need to reset their hardware state instead
  458. * of preserving it, to ensure that it's never mistaken for the
  459. * state which that earlier snapshot had set up.
  460. *
  461. * A minimally power-aware driver treats all messages as SUSPEND, fully
  462. * reinitializes its device during resume() -- whether or not it was reset
  463. * during the suspend/resume cycle -- and can't issue wakeup events.
  464. *
  465. * More power-aware drivers may also use low power states at runtime as
  466. * well as during system sleep states like PM_SUSPEND_STANDBY. They may
  467. * be able to use wakeup events to exit from runtime low-power states,
  468. * or from system low-power states such as standby or suspend-to-RAM.
  469. */
  470. #ifdef CONFIG_PM_SLEEP
  471. extern void device_pm_lock(void);
  472. extern int sysdev_resume(void);
  473. extern void dpm_resume_noirq(pm_message_t state);
  474. extern void dpm_resume_end(pm_message_t state);
  475. extern void device_pm_unlock(void);
  476. extern int sysdev_suspend(pm_message_t state);
  477. extern int dpm_suspend_noirq(pm_message_t state);
  478. extern int dpm_suspend_start(pm_message_t state);
  479. extern void __suspend_report_result(const char *function, void *fn, int ret);
  480. #define suspend_report_result(fn, ret) \
  481. do { \
  482. __suspend_report_result(__func__, fn, ret); \
  483. } while (0)
  484. #else /* !CONFIG_PM_SLEEP */
  485. #define device_pm_lock() do {} while (0)
  486. #define device_pm_unlock() do {} while (0)
  487. static inline int dpm_suspend_start(pm_message_t state)
  488. {
  489. return 0;
  490. }
  491. #define suspend_report_result(fn, ret) do {} while (0)
  492. #endif /* !CONFIG_PM_SLEEP */
  493. /* How to reorder dpm_list after device_move() */
  494. enum dpm_order {
  495. DPM_ORDER_NONE,
  496. DPM_ORDER_DEV_AFTER_PARENT,
  497. DPM_ORDER_PARENT_BEFORE_DEV,
  498. DPM_ORDER_DEV_LAST,
  499. };
  500. /*
  501. * Global Power Management flags
  502. * Used to keep APM and ACPI from both being active
  503. */
  504. extern unsigned int pm_flags;
  505. #define PM_APM 1
  506. #define PM_ACPI 2
  507. #endif /* _LINUX_PM_H */