summaryrefslogtreecommitdiff
path: root/include/linux/pm_wakeup.h
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2020-11-19 08:25:39 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-11-23 18:34:55 +0100
commit4e1d9a737d00f2cc811dc5654f82c92c7d80e98c (patch)
tree71088fb08b6d338b88fbab7de414d05c5452461e /include/linux/pm_wakeup.h
parentab150c3f80dcce670926ab3ca412be5047011d22 (diff)
PM: sleep: Add dev_wakeup_path() helper
Add dev_wakeup_path() helper to avoid to spread dev->power.wakeup_path test in drivers. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/pm_wakeup.h')
-rw-r--r--include/linux/pm_wakeup.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index aa3da6611533..196a157456aa 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -84,6 +84,11 @@ static inline bool device_may_wakeup(struct device *dev)
return dev->power.can_wakeup && !!dev->power.wakeup;
}
+static inline bool device_wakeup_path(struct device *dev)
+{
+ return dev->power.wakeup_path;
+}
+
static inline void device_set_wakeup_path(struct device *dev)
{
dev->power.wakeup_path = true;
@@ -174,6 +179,11 @@ static inline bool device_may_wakeup(struct device *dev)
return dev->power.can_wakeup && dev->power.should_wakeup;
}
+static inline bool device_wakeup_path(struct device *dev)
+{
+ return false;
+}
+
static inline void device_set_wakeup_path(struct device *dev) {}
static inline void __pm_stay_awake(struct wakeup_source *ws) {}