diff options
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 71 |
1 files changed, 43 insertions, 28 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 8c6583a53a06..d915d0345fa1 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -264,9 +264,9 @@ typedef struct pm_message { | |||
264 | * registers, so that it is fully operational. | 264 | * registers, so that it is fully operational. |
265 | * | 265 | * |
266 | * @runtime_idle: Device appears to be inactive and it might be put into a | 266 | * @runtime_idle: Device appears to be inactive and it might be put into a |
267 | * low-power state if all of the necessary conditions are satisfied. Check | 267 | * low-power state if all of the necessary conditions are satisfied. |
268 | * these conditions and handle the device as appropriate, possibly queueing | 268 | * Check these conditions, and return 0 if it's appropriate to let the PM |
269 | * a suspend request for it. The return value is ignored by the PM core. | 269 | * core queue a suspend request for the device. |
270 | * | 270 | * |
271 | * Refer to Documentation/power/runtime_pm.txt for more information about the | 271 | * Refer to Documentation/power/runtime_pm.txt for more information about the |
272 | * role of the above callbacks in device runtime power management. | 272 | * role of the above callbacks in device runtime power management. |
@@ -352,7 +352,7 @@ const struct dev_pm_ops name = { \ | |||
352 | 352 | ||
353 | /* | 353 | /* |
354 | * Use this for defining a set of PM operations to be used in all situations | 354 | * Use this for defining a set of PM operations to be used in all situations |
355 | * (sustem suspend, hibernation or runtime PM). | 355 | * (system suspend, hibernation or runtime PM). |
356 | * NOTE: In general, system suspend callbacks, .suspend() and .resume(), should | 356 | * NOTE: In general, system suspend callbacks, .suspend() and .resume(), should |
357 | * be different from the corresponding runtime PM callbacks, .runtime_suspend(), | 357 | * be different from the corresponding runtime PM callbacks, .runtime_suspend(), |
358 | * and .runtime_resume(), because .runtime_suspend() always works on an already | 358 | * and .runtime_resume(), because .runtime_suspend() always works on an already |
@@ -379,7 +379,7 @@ const struct dev_pm_ops name = { \ | |||
379 | * | 379 | * |
380 | * ON No transition. | 380 | * ON No transition. |
381 | * | 381 | * |
382 | * FREEZE System is going to hibernate, call ->prepare() and ->freeze() | 382 | * FREEZE System is going to hibernate, call ->prepare() and ->freeze() |
383 | * for all devices. | 383 | * for all devices. |
384 | * | 384 | * |
385 | * SUSPEND System is going to suspend, call ->prepare() and ->suspend() | 385 | * SUSPEND System is going to suspend, call ->prepare() and ->suspend() |
@@ -423,7 +423,7 @@ const struct dev_pm_ops name = { \ | |||
423 | 423 | ||
424 | #define PM_EVENT_INVALID (-1) | 424 | #define PM_EVENT_INVALID (-1) |
425 | #define PM_EVENT_ON 0x0000 | 425 | #define PM_EVENT_ON 0x0000 |
426 | #define PM_EVENT_FREEZE 0x0001 | 426 | #define PM_EVENT_FREEZE 0x0001 |
427 | #define PM_EVENT_SUSPEND 0x0002 | 427 | #define PM_EVENT_SUSPEND 0x0002 |
428 | #define PM_EVENT_HIBERNATE 0x0004 | 428 | #define PM_EVENT_HIBERNATE 0x0004 |
429 | #define PM_EVENT_QUIESCE 0x0008 | 429 | #define PM_EVENT_QUIESCE 0x0008 |
@@ -542,6 +542,8 @@ struct dev_pm_info { | |||
542 | unsigned int async_suspend:1; | 542 | unsigned int async_suspend:1; |
543 | bool is_prepared:1; /* Owned by the PM core */ | 543 | bool is_prepared:1; /* Owned by the PM core */ |
544 | bool is_suspended:1; /* Ditto */ | 544 | bool is_suspended:1; /* Ditto */ |
545 | bool is_noirq_suspended:1; | ||
546 | bool is_late_suspended:1; | ||
545 | bool ignore_children:1; | 547 | bool ignore_children:1; |
546 | bool early_init:1; /* Owned by the PM core */ | 548 | bool early_init:1; /* Owned by the PM core */ |
547 | spinlock_t lock; | 549 | spinlock_t lock; |
@@ -582,6 +584,7 @@ struct dev_pm_info { | |||
582 | unsigned long accounting_timestamp; | 584 | unsigned long accounting_timestamp; |
583 | #endif | 585 | #endif |
584 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ | 586 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ |
587 | void (*set_latency_tolerance)(struct device *, s32); | ||
585 | struct dev_pm_qos *qos; | 588 | struct dev_pm_qos *qos; |
586 | }; | 589 | }; |
587 | 590 | ||
@@ -612,11 +615,11 @@ struct dev_pm_domain { | |||
612 | * message is implicit: | 615 | * message is implicit: |
613 | * | 616 | * |
614 | * ON Driver starts working again, responding to hardware events | 617 | * ON Driver starts working again, responding to hardware events |
615 | * and software requests. The hardware may have gone through | 618 | * and software requests. The hardware may have gone through |
616 | * a power-off reset, or it may have maintained state from the | 619 | * a power-off reset, or it may have maintained state from the |
617 | * previous suspend() which the driver will rely on while | 620 | * previous suspend() which the driver will rely on while |
618 | * resuming. On most platforms, there are no restrictions on | 621 | * resuming. On most platforms, there are no restrictions on |
619 | * availability of resources like clocks during resume(). | 622 | * availability of resources like clocks during resume(). |
620 | * | 623 | * |
621 | * Other transitions are triggered by messages sent using suspend(). All | 624 | * Other transitions are triggered by messages sent using suspend(). All |
622 | * these transitions quiesce the driver, so that I/O queues are inactive. | 625 | * these transitions quiesce the driver, so that I/O queues are inactive. |
@@ -626,21 +629,21 @@ struct dev_pm_domain { | |||
626 | * differ according to the message: | 629 | * differ according to the message: |
627 | * | 630 | * |
628 | * SUSPEND Quiesce, enter a low power device state appropriate for | 631 | * SUSPEND Quiesce, enter a low power device state appropriate for |
629 | * the upcoming system state (such as PCI_D3hot), and enable | 632 | * the upcoming system state (such as PCI_D3hot), and enable |
630 | * wakeup events as appropriate. | 633 | * wakeup events as appropriate. |
631 | * | 634 | * |
632 | * HIBERNATE Enter a low power device state appropriate for the hibernation | 635 | * HIBERNATE Enter a low power device state appropriate for the hibernation |
633 | * state (eg. ACPI S4) and enable wakeup events as appropriate. | 636 | * state (eg. ACPI S4) and enable wakeup events as appropriate. |
634 | * | 637 | * |
635 | * FREEZE Quiesce operations so that a consistent image can be saved; | 638 | * FREEZE Quiesce operations so that a consistent image can be saved; |
636 | * but do NOT otherwise enter a low power device state, and do | 639 | * but do NOT otherwise enter a low power device state, and do |
637 | * NOT emit system wakeup events. | 640 | * NOT emit system wakeup events. |
638 | * | 641 | * |
639 | * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring | 642 | * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring |
640 | * the system from a snapshot taken after an earlier FREEZE. | 643 | * the system from a snapshot taken after an earlier FREEZE. |
641 | * Some drivers will need to reset their hardware state instead | 644 | * Some drivers will need to reset their hardware state instead |
642 | * of preserving it, to ensure that it's never mistaken for the | 645 | * of preserving it, to ensure that it's never mistaken for the |
643 | * state which that earlier snapshot had set up. | 646 | * state which that earlier snapshot had set up. |
644 | * | 647 | * |
645 | * A minimally power-aware driver treats all messages as SUSPEND, fully | 648 | * A minimally power-aware driver treats all messages as SUSPEND, fully |
646 | * reinitializes its device during resume() -- whether or not it was reset | 649 | * reinitializes its device during resume() -- whether or not it was reset |
@@ -717,14 +720,26 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void | |||
717 | { | 720 | { |
718 | } | 721 | } |
719 | 722 | ||
720 | #define pm_generic_prepare NULL | 723 | #define pm_generic_prepare NULL |
721 | #define pm_generic_suspend NULL | 724 | #define pm_generic_suspend_late NULL |
722 | #define pm_generic_resume NULL | 725 | #define pm_generic_suspend_noirq NULL |
723 | #define pm_generic_freeze NULL | 726 | #define pm_generic_suspend NULL |
724 | #define pm_generic_thaw NULL | 727 | #define pm_generic_resume_early NULL |
725 | #define pm_generic_restore NULL | 728 | #define pm_generic_resume_noirq NULL |
726 | #define pm_generic_poweroff NULL | 729 | #define pm_generic_resume NULL |
727 | #define pm_generic_complete NULL | 730 | #define pm_generic_freeze_noirq NULL |
731 | #define pm_generic_freeze_late NULL | ||
732 | #define pm_generic_freeze NULL | ||
733 | #define pm_generic_thaw_noirq NULL | ||
734 | #define pm_generic_thaw_early NULL | ||
735 | #define pm_generic_thaw NULL | ||
736 | #define pm_generic_restore_noirq NULL | ||
737 | #define pm_generic_restore_early NULL | ||
738 | #define pm_generic_restore NULL | ||
739 | #define pm_generic_poweroff_noirq NULL | ||
740 | #define pm_generic_poweroff_late NULL | ||
741 | #define pm_generic_poweroff NULL | ||
742 | #define pm_generic_complete NULL | ||
728 | #endif /* !CONFIG_PM_SLEEP */ | 743 | #endif /* !CONFIG_PM_SLEEP */ |
729 | 744 | ||
730 | /* How to reorder dpm_list after device_move() */ | 745 | /* How to reorder dpm_list after device_move() */ |