diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2015-07-28 20:51:30 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-07-28 20:51:30 +0200 |
commit | 19aab273083fa10c2262b8c8e3315bacb054d75d (patch) | |
tree | 65097982915b51acdf8d5576d63153085b779ceb /drivers/clk/qcom/clk-pll.c | |
parent | clk: st: Fix error paths and allocation style (diff) | |
parent | clk: fix some determine_rate implementations (diff) | |
download | linux-19aab273083fa10c2262b8c8e3315bacb054d75d.tar.xz linux-19aab273083fa10c2262b8c8e3315bacb054d75d.zip |
Merge branch 'clk-determine-rate-struct' into clk-next
* clk-determine-rate-struct:
clk: fix some determine_rate implementations
clk: change clk_ops' ->determine_rate() prototype
Diffstat (limited to 'drivers/clk/qcom/clk-pll.c')
-rw-r--r-- | drivers/clk/qcom/clk-pll.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/clk/qcom/clk-pll.c b/drivers/clk/qcom/clk-pll.c index 017eede87237..a34656bec648 100644 --- a/drivers/clk/qcom/clk-pll.c +++ b/drivers/clk/qcom/clk-pll.c @@ -135,19 +135,23 @@ struct pll_freq_tbl *find_freq(const struct pll_freq_tbl *f, unsigned long rate) return NULL; } -static long -clk_pll_determine_rate(struct clk_hw *hw, unsigned long rate, - unsigned long min_rate, unsigned long max_rate, - unsigned long *p_rate, struct clk_hw **p) +static int +clk_pll_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { + struct clk *parent = __clk_get_parent(hw->clk); struct clk_pll *pll = to_clk_pll(hw); const struct pll_freq_tbl *f; - f = find_freq(pll->freq_tbl, rate); + req->best_parent_hw = __clk_get_hw(parent); + req->best_parent_rate = __clk_get_rate(parent); + + f = find_freq(pll->freq_tbl, req->rate); if (!f) - return clk_pll_recalc_rate(hw, *p_rate); + req->rate = clk_pll_recalc_rate(hw, req->best_parent_rate); + else + req->rate = f->freq; - return f->freq; + return 0; } static int |