Commit 925b44a2 authored by Mark Brown's avatar Mark Brown Committed by Rafael J. Wysocki

PM / Domains: Provide an always on power domain governor

Since systems are likely to have power domains that can't be turned off
for various reasons at least temporarily while implementing power domain
support provide a default governor which will always refuse to power off
the domain, saving platforms having to implement their own.

Since the code is so tiny don't bother with a Kconfig symbol for it.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent c9914854
......@@ -141,3 +141,16 @@ struct dev_power_governor simple_qos_governor = {
.stop_ok = default_stop_ok,
.power_down_ok = default_power_down_ok,
};
static bool always_on_power_down_ok(struct dev_pm_domain *domain)
{
return false;
}
/**
* pm_genpd_gov_always_on - A governor implementing an always-on policy
*/
struct dev_power_governor pm_domain_always_on_gov = {
.power_down_ok = always_on_power_down_ok,
.stop_ok = default_stop_ok,
};
......@@ -140,6 +140,7 @@ extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
extern bool default_stop_ok(struct device *dev);
extern struct dev_power_governor pm_domain_always_on_gov;
#else
static inline struct generic_pm_domain *dev_to_genpd(struct device *dev)
......@@ -193,6 +194,7 @@ static inline bool default_stop_ok(struct device *dev)
{
return false;
}
#define pm_domain_always_on_gov NULL
#endif
static inline int pm_genpd_remove_callbacks(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment