diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2014-05-16 16:07:10 -0700 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-05-29 09:30:22 -0700 |
commit | 9d011f3b71f635ff8e664e7e32bb764918cb1e8e (patch) | |
tree | 9428ad45c4f005fa1fcd50a918eb540cc9c2fd74 /drivers | |
parent | 437ae6a1b8f2eedebfbf0f6572e19ca5c58a3f71 (diff) |
clk: qcom: Return highest rate when round_rate() exceeds plan
Some drivers may want to call clk_set_rate() with a very large
number to force the clock to go as fast as it possibly can
without having to know the range between the highest rate and
second highest rate. Add support for this by defaulting to the
highest rate in the frequency table if we can't find a frequency
greater than what is requested.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/qcom/clk-rcg2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 0996a3a3985..cbecaec3056 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -181,7 +181,8 @@ struct freq_tbl *find_freq(const struct freq_tbl *f, unsigned long rate) if (rate <= f->freq) return f; - return NULL; + /* Default to our fastest rate */ + return f - 1; } static long _freq_tbl_determine_rate(struct clk_hw *hw, |