diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-01-17 20:55:09 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-01-17 20:55:09 -0500 |
commit | 4b67157f04b584379dd0e7426bf3485a85c9bb77 (patch) | |
tree | e2a7a619f2062aa2ae9fd4e69c4125ea470fc18f /include | |
parent | f9b736f64aae9252a1f71fcf64c7aeee4f5d0e29 (diff) | |
parent | 1131b0a4af911de50b22239cabdf6dcd3f15df15 (diff) |
Merge branch 'pm-core'
* pm-core: (29 commits)
dmaengine: rcar-dmac: Make DMAC reinit during system resume explicit
PM / runtime: Allow no callbacks in pm_runtime_force_suspend|resume()
PM / runtime: Check ignore_children in pm_runtime_need_not_resume()
PM / runtime: Rework pm_runtime_force_suspend/resume()
PM / wakeup: Print warn if device gets enabled as wakeup source during sleep
PM / core: Propagate wakeup_path status flag in __device_suspend_late()
PM / core: Re-structure code for clearing the direct_complete flag
PM: i2c-designware-platdrv: Optimize power management
PM: i2c-designware-platdrv: Use DPM_FLAG_SMART_PREPARE
PM / mfd: intel-lpss: Use DPM_FLAG_SMART_SUSPEND
PCI / PM: Use SMART_SUSPEND and LEAVE_SUSPENDED flags for PCIe ports
PM / wakeup: Add device_set_wakeup_path() helper to control wakeup path
PM / core: Assign the wakeup_path status flag in __device_prepare()
PM / wakeup: Do not fail dev_pm_attach_wake_irq() unnecessarily
PM / core: Direct DPM_FLAG_LEAVE_SUSPENDED handling
PM / core: Direct DPM_FLAG_SMART_SUSPEND optimization
PM / core: Add helpers for subsystem callback selection
PM / wakeup: Drop redundant check from device_init_wakeup()
PM / wakeup: Drop redundant check from device_set_wakeup_enable()
PM / wakeup: only recommend "call"ing device_init_wakeup() once
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pm.h | 16 | ||||
-rw-r--r-- | include/linux/pm_wakeup.h | 7 |
2 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 492ed473ba7e..e723b78d8357 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -556,9 +556,10 @@ struct pm_subsys_data { | |||
556 | * These flags can be set by device drivers at the probe time. They need not be | 556 | * These flags can be set by device drivers at the probe time. They need not be |
557 | * cleared by the drivers as the driver core will take care of that. | 557 | * cleared by the drivers as the driver core will take care of that. |
558 | * | 558 | * |
559 | * NEVER_SKIP: Do not skip system suspend/resume callbacks for the device. | 559 | * NEVER_SKIP: Do not skip all system suspend/resume callbacks for the device. |
560 | * SMART_PREPARE: Check the return value of the driver's ->prepare callback. | 560 | * SMART_PREPARE: Check the return value of the driver's ->prepare callback. |
561 | * SMART_SUSPEND: No need to resume the device from runtime suspend. | 561 | * SMART_SUSPEND: No need to resume the device from runtime suspend. |
562 | * LEAVE_SUSPENDED: Avoid resuming the device during system resume if possible. | ||
562 | * | 563 | * |
563 | * Setting SMART_PREPARE instructs bus types and PM domains which may want | 564 | * Setting SMART_PREPARE instructs bus types and PM domains which may want |
564 | * system suspend/resume callbacks to be skipped for the device to return 0 from | 565 | * system suspend/resume callbacks to be skipped for the device to return 0 from |
@@ -572,10 +573,14 @@ struct pm_subsys_data { | |||
572 | * necessary from the driver's perspective. It also may cause them to skip | 573 | * necessary from the driver's perspective. It also may cause them to skip |
573 | * invocations of the ->suspend_late and ->suspend_noirq callbacks provided by | 574 | * invocations of the ->suspend_late and ->suspend_noirq callbacks provided by |
574 | * the driver if they decide to leave the device in runtime suspend. | 575 | * the driver if they decide to leave the device in runtime suspend. |
576 | * | ||
577 | * Setting LEAVE_SUSPENDED informs the PM core and middle-layer code that the | ||
578 | * driver prefers the device to be left in suspend after system resume. | ||
575 | */ | 579 | */ |
576 | #define DPM_FLAG_NEVER_SKIP BIT(0) | 580 | #define DPM_FLAG_NEVER_SKIP BIT(0) |
577 | #define DPM_FLAG_SMART_PREPARE BIT(1) | 581 | #define DPM_FLAG_SMART_PREPARE BIT(1) |
578 | #define DPM_FLAG_SMART_SUSPEND BIT(2) | 582 | #define DPM_FLAG_SMART_SUSPEND BIT(2) |
583 | #define DPM_FLAG_LEAVE_SUSPENDED BIT(3) | ||
579 | 584 | ||
580 | struct dev_pm_info { | 585 | struct dev_pm_info { |
581 | pm_message_t power_state; | 586 | pm_message_t power_state; |
@@ -597,6 +602,8 @@ struct dev_pm_info { | |||
597 | bool wakeup_path:1; | 602 | bool wakeup_path:1; |
598 | bool syscore:1; | 603 | bool syscore:1; |
599 | bool no_pm_callbacks:1; /* Owned by the PM core */ | 604 | bool no_pm_callbacks:1; /* Owned by the PM core */ |
605 | unsigned int must_resume:1; /* Owned by the PM core */ | ||
606 | unsigned int may_skip_resume:1; /* Set by subsystems */ | ||
600 | #else | 607 | #else |
601 | unsigned int should_wakeup:1; | 608 | unsigned int should_wakeup:1; |
602 | #endif | 609 | #endif |
@@ -766,6 +773,7 @@ extern int pm_generic_poweroff(struct device *dev); | |||
766 | extern void pm_generic_complete(struct device *dev); | 773 | extern void pm_generic_complete(struct device *dev); |
767 | 774 | ||
768 | extern void dev_pm_skip_next_resume_phases(struct device *dev); | 775 | extern void dev_pm_skip_next_resume_phases(struct device *dev); |
776 | extern bool dev_pm_may_skip_resume(struct device *dev); | ||
769 | extern bool dev_pm_smart_suspend_and_suspended(struct device *dev); | 777 | extern bool dev_pm_smart_suspend_and_suspended(struct device *dev); |
770 | 778 | ||
771 | #else /* !CONFIG_PM_SLEEP */ | 779 | #else /* !CONFIG_PM_SLEEP */ |
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 4c2cba7ec1d4..4238dde0aaf0 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h | |||
@@ -88,6 +88,11 @@ static inline bool device_may_wakeup(struct device *dev) | |||
88 | return dev->power.can_wakeup && !!dev->power.wakeup; | 88 | return dev->power.can_wakeup && !!dev->power.wakeup; |
89 | } | 89 | } |
90 | 90 | ||
91 | static inline void device_set_wakeup_path(struct device *dev) | ||
92 | { | ||
93 | dev->power.wakeup_path = true; | ||
94 | } | ||
95 | |||
91 | /* drivers/base/power/wakeup.c */ | 96 | /* drivers/base/power/wakeup.c */ |
92 | extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name); | 97 | extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name); |
93 | extern struct wakeup_source *wakeup_source_create(const char *name); | 98 | extern struct wakeup_source *wakeup_source_create(const char *name); |
@@ -174,6 +179,8 @@ static inline bool device_may_wakeup(struct device *dev) | |||
174 | return dev->power.can_wakeup && dev->power.should_wakeup; | 179 | return dev->power.can_wakeup && dev->power.should_wakeup; |
175 | } | 180 | } |
176 | 181 | ||
182 | static inline void device_set_wakeup_path(struct device *dev) {} | ||
183 | |||
177 | static inline void __pm_stay_awake(struct wakeup_source *ws) {} | 184 | static inline void __pm_stay_awake(struct wakeup_source *ws) {} |
178 | 185 | ||
179 | static inline void pm_stay_awake(struct device *dev) {} | 186 | static inline void pm_stay_awake(struct device *dev) {} |