Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / sleep: Add macro to define common noirq system PM callbacks

The same approach is used as for the existing SET_SYSTEM_SLEEP_PM_OPS,
but for noirq callbacks.

New SET_NOIRQ_SYSTEM_SLEEP_PM_OPS, defined for CONFIG_PM_SLEEP, will
point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same
function. Vice versa happens for ->resume_noirq, ->thaw_noirq and
->restore_noirq.

Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Grygorii Strashko and committed by
Rafael J. Wysocki
020af89a a9215045

+12
+12
include/linux/pm.h
··· 342 342 #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) 343 343 #endif 344 344 345 + #ifdef CONFIG_PM_SLEEP 346 + #define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ 347 + .suspend_noirq = suspend_fn, \ 348 + .resume_noirq = resume_fn, \ 349 + .freeze_noirq = suspend_fn, \ 350 + .thaw_noirq = resume_fn, \ 351 + .poweroff_noirq = suspend_fn, \ 352 + .restore_noirq = resume_fn, 353 + #else 354 + #define SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) 355 + #endif 356 + 345 357 #ifdef CONFIG_PM 346 358 #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ 347 359 .runtime_suspend = suspend_fn, \