Skip to content

Commit

Permalink
clk: qcom: Return highest rate when round_rate() exceeds plan
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Boyd authored and Mike Turquette committed May 29, 2014
1 parent 437ae6a commit 9d011f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/clk/qcom/clk-rcg2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9d011f3

Please sign in to comment.