summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-04-12 20:50:18 +0800
committerMike Turquette <mturquette@linaro.org>2012-04-24 16:37:40 -0700
commit1c0035d710dd3bfa86d58f851b8737c7f11a9bbc (patch)
tree37ebd1a44c408aecf7df5331d2b5a32e81818baf /drivers/clk
parent81536e072b54e30bbfd1a9a6b8094f7b3dd5321c (diff)
downloadop-kernel-dev-1c0035d710dd3bfa86d58f851b8737c7f11a9bbc.zip
op-kernel-dev-1c0035d710dd3bfa86d58f851b8737c7f11a9bbc.tar.gz
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 <shawn.guo@linaro.org> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk-divider.c5
-rw-r--r--drivers/clk/clk.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 03b127c..90627e4 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -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--;
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 1ab4f7e..62ecac53 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -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,
OpenPOWER on IntegriCloud