mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
clk: pass parent_rate into .set_rate
For most of .set_rate implementation, parent_rate will be used, so just like passing parent_rate into .recalc_rate, let's pass parent_rate into .set_rate too. It also updates the kernel doc for .set_rate ops. Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Mike Turquette <[email protected]>
This commit is contained in:
parent
81536e072b
commit
1c0035d710
3 changed files with 11 additions and 17 deletions
|
|
@ -111,14 +111,15 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
|
|||
return *prate / div;
|
||||
}
|
||||
|
||||
static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate)
|
||||
static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
struct clk_divider *divider = to_clk_divider(hw);
|
||||
unsigned int div;
|
||||
unsigned long flags = 0;
|
||||
u32 val;
|
||||
|
||||
div = __clk_get_rate(__clk_get_parent(hw->clk)) / rate;
|
||||
div = parent_rate / rate;
|
||||
|
||||
if (!(divider->flags & CLK_DIVIDER_ONE_BASED))
|
||||
div--;
|
||||
|
|
|
|||
|
|
@ -848,7 +848,7 @@ static void clk_change_rate(struct clk *clk)
|
|||
old_rate = clk->rate;
|
||||
|
||||
if (clk->ops->set_rate)
|
||||
clk->ops->set_rate(clk->hw, clk->new_rate);
|
||||
clk->ops->set_rate(clk->hw, clk->new_rate, clk->parent->rate);
|
||||
|
||||
if (clk->ops->recalc_rate)
|
||||
clk->rate = clk->ops->recalc_rate(clk->hw,
|
||||
|
|
|
|||
Loading…
Reference in a new issue