aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-06-13 15:10:21 +0530
committerAlex Shi <alex.shi@linaro.org>2015-10-28 11:23:43 +0800
commite4b0c3da5c6e99a72fd82cc8fc5ab28b96d66a14 (patch)
tree767a41251041a900fb6a975f2a264909f3341158
parent6fdde8fc9f5a7783bcb3354fa304e549a3d5584a (diff)
PM / OPP: Add support for opp-suspend
With "operating-points-v2" bindings, it's possible to specify the OPP to which the device must be switched, before suspending. This patch adds support for getting that information. Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit ad656a6a8b1c8b4b2e723646e0402867f2f45395) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--drivers/base/power/opp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 5d699e3ec136..0ebcea49145a 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -133,6 +133,7 @@ struct device_opp {
struct device_node *np;
unsigned long clock_latency_ns_max;
bool shared_opp;
+ struct dev_pm_opp *suspend_opp;
};
/*
@@ -923,6 +924,16 @@ static int _opp_add_static_v2(struct device *dev, struct device_node *np)
if (ret)
goto free_opp;
+ /* OPP to select on device suspend */
+ if (of_property_read_bool(np, "opp-suspend")) {
+ if (dev_opp->suspend_opp)
+ dev_warn(dev, "%s: Multiple suspend OPPs found (%lu %lu)\n",
+ __func__, dev_opp->suspend_opp->rate,
+ new_opp->rate);
+ else
+ dev_opp->suspend_opp = new_opp;
+ }
+
if (new_opp->clock_latency_ns > dev_opp->clock_latency_ns_max)
dev_opp->clock_latency_ns_max = new_opp->clock_latency_ns;