aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-03-07 18:55:06 -0500
committerJames Morris <jmorris@namei.org>2011-03-07 18:55:06 -0500
commit1cc26bada9f6807814806db2f0d78792eecdac71 (patch)
tree5509b5139db04af6c13db0a580c84116a4a54039 /include/linux/pm.h
parenteae61f3c829439f8f9121b5cd48a14be04df451f (diff)
parent214d93b02c4fe93638ad268613c9702a81ed9192 (diff)
Merge branch 'master'; commit 'v2.6.38-rc7' into next
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h53
1 files changed, 12 insertions, 41 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 40f3f45702ba..21415cc91cbb 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -367,45 +367,6 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
367 { .event = PM_EVENT_AUTO_RESUME, }) 367 { .event = PM_EVENT_AUTO_RESUME, })
368 368
369/** 369/**
370 * Device power management states
371 *
372 * These state labels are used internally by the PM core to indicate the current
373 * status of a device with respect to the PM core operations.
374 *
375 * DPM_ON Device is regarded as operational. Set this way
376 * initially and when ->complete() is about to be called.
377 * Also set when ->prepare() fails.
378 *
379 * DPM_PREPARING Device is going to be prepared for a PM transition. Set
380 * when ->prepare() is about to be called.
381 *
382 * DPM_RESUMING Device is going to be resumed. Set when ->resume(),
383 * ->thaw(), or ->restore() is about to be called.
384 *
385 * DPM_SUSPENDING Device has been prepared for a power transition. Set
386 * when ->prepare() has just succeeded.
387 *
388 * DPM_OFF Device is regarded as inactive. Set immediately after
389 * ->suspend(), ->freeze(), or ->poweroff() has succeeded.
390 * Also set when ->resume()_noirq, ->thaw_noirq(), or
391 * ->restore_noirq() is about to be called.
392 *
393 * DPM_OFF_IRQ Device is in a "deep sleep". Set immediately after
394 * ->suspend_noirq(), ->freeze_noirq(), or
395 * ->poweroff_noirq() has just succeeded.
396 */
397
398enum dpm_state {
399 DPM_INVALID,
400 DPM_ON,
401 DPM_PREPARING,
402 DPM_RESUMING,
403 DPM_SUSPENDING,
404 DPM_OFF,
405 DPM_OFF_IRQ,
406};
407
408/**
409 * Device run-time power management status. 370 * Device run-time power management status.
410 * 371 *
411 * These status labels are used internally by the PM core to indicate the 372 * These status labels are used internally by the PM core to indicate the
@@ -463,13 +424,15 @@ struct wakeup_source;
463struct dev_pm_info { 424struct dev_pm_info {
464 pm_message_t power_state; 425 pm_message_t power_state;
465 unsigned int can_wakeup:1; 426 unsigned int can_wakeup:1;
466 unsigned async_suspend:1; 427 unsigned int async_suspend:1;
467 enum dpm_state status; /* Owned by the PM core */ 428 unsigned int in_suspend:1; /* Owned by the PM core */
468 spinlock_t lock; 429 spinlock_t lock;
469#ifdef CONFIG_PM_SLEEP 430#ifdef CONFIG_PM_SLEEP
470 struct list_head entry; 431 struct list_head entry;
471 struct completion completion; 432 struct completion completion;
472 struct wakeup_source *wakeup; 433 struct wakeup_source *wakeup;
434#else
435 unsigned int should_wakeup:1;
473#endif 436#endif
474#ifdef CONFIG_PM_RUNTIME 437#ifdef CONFIG_PM_RUNTIME
475 struct timer_list suspend_timer; 438 struct timer_list suspend_timer;
@@ -486,6 +449,7 @@ struct dev_pm_info {
486 unsigned int run_wake:1; 449 unsigned int run_wake:1;
487 unsigned int runtime_auto:1; 450 unsigned int runtime_auto:1;
488 unsigned int no_callbacks:1; 451 unsigned int no_callbacks:1;
452 unsigned int irq_safe:1;
489 unsigned int use_autosuspend:1; 453 unsigned int use_autosuspend:1;
490 unsigned int timer_autosuspends:1; 454 unsigned int timer_autosuspends:1;
491 enum rpm_request request; 455 enum rpm_request request;
@@ -610,4 +574,11 @@ extern unsigned int pm_flags;
610#define PM_APM 1 574#define PM_APM 1
611#define PM_ACPI 2 575#define PM_ACPI 2
612 576
577extern int pm_generic_suspend(struct device *dev);
578extern int pm_generic_resume(struct device *dev);
579extern int pm_generic_freeze(struct device *dev);
580extern int pm_generic_thaw(struct device *dev);
581extern int pm_generic_restore(struct device *dev);
582extern int pm_generic_poweroff(struct device *dev);
583
613#endif /* _LINUX_PM_H */ 584#endif /* _LINUX_PM_H */