summaryrefslogtreecommitdiffstats
path: root/drivers/clk/sunxi-ng/ccu_mux.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_mux.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_mux.c')
-rw-r--r--drivers/clk/sunxi-ng/ccu_mux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/clk/sunxi-ng/ccu_mux.c b/drivers/clk/sunxi-ng/ccu_mux.c
index c6bb1f523232..bae735e252b6 100644
--- a/drivers/clk/sunxi-ng/ccu_mux.c
+++ b/drivers/clk/sunxi-ng/ccu_mux.c
@@ -61,7 +61,8 @@ int ccu_mux_helper_determine_rate(struct ccu_common *common,
struct ccu_mux_internal *cm,
struct clk_rate_request *req,
unsigned long (*round)(struct ccu_mux_internal *,
- unsigned long,
+ struct clk_hw *,
+ unsigned long *,
unsigned long,
void *),
void *data)
@@ -80,7 +81,8 @@ int ccu_mux_helper_determine_rate(struct ccu_common *common,
ccu_mux_helper_adjust_parent_for_prediv(common, cm, -1,
&adj_parent_rate);
- best_rate = round(cm, adj_parent_rate, req->rate, data);
+ best_rate = round(cm, best_parent, &adj_parent_rate,
+ req->rate, data);
goto out;
}
@@ -109,7 +111,7 @@ int ccu_mux_helper_determine_rate(struct ccu_common *common,
ccu_mux_helper_adjust_parent_for_prediv(common, cm, i,
&adj_parent_rate);
- tmp_rate = round(cm, adj_parent_rate, req->rate, data);
+ tmp_rate = round(cm, parent, &adj_parent_rate, req->rate, data);
if (tmp_rate == req->rate) {
best_parent = parent;
best_parent_rate = parent_rate;