diff options
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index a224c7f5c377..8c6583a53a06 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -311,6 +311,18 @@ struct dev_pm_ops { | |||
311 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | 311 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) |
312 | #endif | 312 | #endif |
313 | 313 | ||
314 | #ifdef CONFIG_PM_SLEEP | ||
315 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ | ||
316 | .suspend_late = suspend_fn, \ | ||
317 | .resume_early = resume_fn, \ | ||
318 | .freeze_late = suspend_fn, \ | ||
319 | .thaw_early = resume_fn, \ | ||
320 | .poweroff_late = suspend_fn, \ | ||
321 | .restore_early = resume_fn, | ||
322 | #else | ||
323 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | ||
324 | #endif | ||
325 | |||
314 | #ifdef CONFIG_PM_RUNTIME | 326 | #ifdef CONFIG_PM_RUNTIME |
315 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | 327 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ |
316 | .runtime_suspend = suspend_fn, \ | 328 | .runtime_suspend = suspend_fn, \ |
@@ -320,6 +332,15 @@ struct dev_pm_ops { | |||
320 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | 332 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) |
321 | #endif | 333 | #endif |
322 | 334 | ||
335 | #ifdef CONFIG_PM | ||
336 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | ||
337 | .runtime_suspend = suspend_fn, \ | ||
338 | .runtime_resume = resume_fn, \ | ||
339 | .runtime_idle = idle_fn, | ||
340 | #else | ||
341 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | ||
342 | #endif | ||
343 | |||
323 | /* | 344 | /* |
324 | * Use this if you want to use the same suspend and resume callbacks for suspend | 345 | * Use this if you want to use the same suspend and resume callbacks for suspend |
325 | * to RAM and hibernation. | 346 | * to RAM and hibernation. |