Skip to content

Commit

Permalink
PM / OPP: Add support for opp-suspend
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Aug 7, 2015
1 parent 0644165 commit ad656a6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/base/power/opp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/*
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit ad656a6

Please sign in to comment.