summaryrefslogtreecommitdiffstats
path: root/drivers/clk/sunxi-ng/ccu_mp.c
diff options
context:
space:
mode:
authorMaxime Ripard2017-05-17 09:40:31 +0200
committerMaxime Ripard2017-06-07 15:32:13 +0200
commit10a8d9b90642da9b6cef477725c4c6bdd4c36cb3 (patch)
tree9b635eaa5a2ce9934dcf0a23cab9aae20a1a45df /drivers/clk/sunxi-ng/ccu_mp.c
parentclk: divider: Make divider_round_rate take the parent clock (diff)
downloadkernel-qcow2-linux-10a8d9b90642da9b6cef477725c4c6bdd4c36cb3.tar.gz
kernel-qcow2-linux-10a8d9b90642da9b6cef477725c4c6bdd4c36cb3.tar.xz
kernel-qcow2-linux-10a8d9b90642da9b6cef477725c4c6bdd4c36cb3.zip
clk: sunxi-ng: Pass the parent and a pointer to the clocks round rate
The clocks might need to modify their parent clocks. In order to make that possible, give them access to the parent clock being evaluated, and to a pointer to the parent rate so that they can modify it if needed. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Diffstat (limited to 'drivers/clk/sunxi-ng/ccu_mp.c')
-rw-r--r--drivers/clk/sunxi-ng/ccu_mp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/clk/sunxi-ng/ccu_mp.c b/drivers/clk/sunxi-ng/ccu_mp.c
index b583f186a804..de02e6c386d8 100644
--- a/drivers/clk/sunxi-ng/ccu_mp.c
+++ b/drivers/clk/sunxi-ng/ccu_mp.c
@@ -41,7 +41,8 @@ static void ccu_mp_find_best(unsigned long parent, unsigned long rate,
}
static unsigned long ccu_mp_round_rate(struct ccu_mux_internal *mux,
- unsigned long parent_rate,
+ struct clk_hw *hw,
+ unsigned long *parent_rate,
unsigned long rate,
void *data)
{
@@ -52,9 +53,9 @@ static unsigned long ccu_mp_round_rate(struct ccu_mux_internal *mux,
max_m = cmp->m.max ?: 1 << cmp->m.width;
max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);
- ccu_mp_find_best(parent_rate, rate, max_m, max_p, &m, &p);
+ ccu_mp_find_best(*parent_rate, rate, max_m, max_p, &m, &p);
- return parent_rate / p / m;
+ return *parent_rate / p / m;
}
static void ccu_mp_disable(struct clk_hw *hw)