Skip to content

Commit

Permalink
clk: sunxi-ng: Call divider_round_rate if we only have a single parent
Browse files Browse the repository at this point in the history
The divider_get_val function that is used in our determine_rate callback
doesn't try to change the parent rate at all, while clk_divider_bestdiv,
used in divider_round_rate, does.

If we have a single parent, call divider_round_rate.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
  • Loading branch information
Maxime Ripard committed Jan 27, 2017
1 parent 6b48644 commit bf3be2c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/clk/sunxi-ng/ccu_div.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ static int ccu_div_determine_rate(struct clk_hw *hw,
{
struct ccu_div *cd = hw_to_ccu_div(hw);

if (clk_hw_get_num_parents(hw) == 1) {
req->rate = divider_round_rate(hw, req->rate,
&req->best_parent_rate,
cd->div.table,
cd->div.width,
cd->div.flags);

req->best_parent_hw = clk_hw_get_parent(hw);

return 0;
}

return ccu_mux_helper_determine_rate(&cd->common, &cd->mux,
req, ccu_div_round_rate, cd);
}
Expand Down

0 comments on commit bf3be2c

Please sign in to comment.