Skip to content

Commit 2a6c0b4

Browse files
committed
pm: Introduce DEFINE_NOIRQ_DEV_PM_OPS() helper
_DEFINE_DEV_PM_OPS() helps to define PM operations for the system sleep and/or runtime PM cases. Some of the existing users want to have _noirq() variants to be set. For that purpose introduce a new helper which sets up _noirq() callbacks to be assigned and struct dev_pm_ops be provided. Acked-by: "Rafael J. Wysocki" <rafael@kernel.org> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230717172821.62827-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 1956149 commit 2a6c0b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/linux/pm.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,15 @@ const struct dev_pm_ops __maybe_unused name = { \
448448
SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
449449
}
450450

451+
/*
452+
* Use this if you want to have the suspend and resume callbacks be called
453+
* with IRQs disabled.
454+
*/
455+
#define DEFINE_NOIRQ_DEV_PM_OPS(name, suspend_fn, resume_fn) \
456+
const struct dev_pm_ops name = { \
457+
NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
458+
}
459+
451460
#define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr))
452461
#define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))
453462

0 commit comments

Comments
 (0)