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>
This commit is contained in:
Maxime Ripard
2017-05-17 09:40:31 +02:00
parent 22833a9165
commit 10a8d9b906
6 changed files with 25 additions and 18 deletions
+5 -3
View File
@@ -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;