From 10a8d9b90642da9b6cef477725c4c6bdd4c36cb3 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 17 May 2017 09:40:31 +0200 Subject: 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 Signed-off-by: Chen-Yu Tsai --- drivers/clk/sunxi-ng/ccu_mux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/clk/sunxi-ng/ccu_mux.c') diff --git a/drivers/clk/sunxi-ng/ccu_mux.c b/drivers/clk/sunxi-ng/ccu_mux.c index c6bb1f5..bae735e 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; -- cgit v1.1