aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-07-17 20:28:12 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-08-21 18:58:09 +0300
commit2a6c0b4777ae51222b6d9d5d5687bd6cbf9ed4f8 (patch)
tree2dde61e4a331132916a3275783d5ead32dfc8641 /include/linux/pm.h
parentpinctrl: lynxpoint: Make use of pm_ptr() (diff)
downloadwireguard-linux-2a6c0b4777ae51222b6d9d5d5687bd6cbf9ed4f8.tar.xz
wireguard-linux-2a6c0b4777ae51222b6d9d5d5687bd6cbf9ed4f8.zip
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>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index badad7d11f4f..1400c37b29c7 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -448,6 +448,15 @@ const struct dev_pm_ops __maybe_unused name = { \
SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
}
+/*
+ * Use this if you want to have the suspend and resume callbacks be called
+ * with IRQs disabled.
+ */
+#define DEFINE_NOIRQ_DEV_PM_OPS(name, suspend_fn, resume_fn) \
+const struct dev_pm_ops name = { \
+ NOIRQ_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
+}
+
#define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr))
#define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr))