summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2017-11-07 15:48:11 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-11-08 03:00:47 +0300
commit95a20ef6f7e54c6a982715a7d0da2fd81790db28 (patch)
tree8c73ac7cb916cb3b766b00dc09ee2fae34215c36 /drivers/base
parent42f6284ae602469762ee721ec31ddfc6170e00bc (diff)
downloadlinux-95a20ef6f7e54c6a982715a7d0da2fd81790db28.tar.xz
PM / Domains: Allow genpd users to specify default active wakeup behavior
It is quite common for PM Domains to require slave devices to be kept active during system suspend if they are to be used as wakeup sources. To enable this, currently each PM Domain or driver has to provide its own gpd_dev_ops.active_wakeup() callback. Introduce a new flag GENPD_FLAG_ACTIVE_WAKEUP to consolidate this. If specified, all slave devices configured as wakeup sources will be kept active during system suspend. PM Domains that need more fine-grained controls, based on the slave device, can still provide their own callbacks, as before. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 7e01ae364d78..e343844357c8 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -124,6 +124,7 @@ static const struct genpd_lock_ops genpd_spin_ops = {
#define genpd_status_on(genpd) (genpd->status == GPD_STATE_ACTIVE)
#define genpd_is_irq_safe(genpd) (genpd->flags & GENPD_FLAG_IRQ_SAFE)
#define genpd_is_always_on(genpd) (genpd->flags & GENPD_FLAG_ALWAYS_ON)
+#define genpd_is_active_wakeup(genpd) (genpd->flags & GENPD_FLAG_ACTIVE_WAKEUP)
static inline bool irq_safe_dev_in_no_sleep_domain(struct device *dev,
const struct generic_pm_domain *genpd)
@@ -868,6 +869,8 @@ static bool genpd_present(const struct generic_pm_domain *genpd)
static bool genpd_dev_active_wakeup(const struct generic_pm_domain *genpd,
struct device *dev)
{
+ if (genpd_is_active_wakeup(genpd))
+ return true;
return GENPD_DEV_CALLBACK(genpd, bool, active_wakeup, dev);
}