Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634918 > unrolled thread

[PATCH v2 3/20] clk: sunxi-ng: div: Switch to divider_round_rate

Started byMaxime Ripard <maxime.ripard@free-electrons.com>
First post2017-05-03 14:10 +0200
Last post2017-05-04 05:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 3/20] clk: sunxi-ng: div: Switch to divider_round_rate Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-05-03 14:10 +0200
    Re: [PATCH v2 3/20] clk: sunxi-ng: div: Switch to divider_round_rate Chen-Yu Tsai <wens@csie.org> - 2017-05-04 05:30 +0200

#1634918 — [PATCH v2 3/20] clk: sunxi-ng: div: Switch to divider_round_rate

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2017-05-03 14:10 +0200
Subject[PATCH v2 3/20] clk: sunxi-ng: div: Switch to divider_round_rate
Message-ID<tD1gv-5a8-33@gated-at.bofh.it>
divider_round_rate already evaluates changing the parent rate if
CLK_SET_RATE_PARENT is set. Now that we can do that on muxes too, let's
just use it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clk/sunxi-ng/ccu_div.c | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/drivers/clk/sunxi-ng/ccu_div.c b/drivers/clk/sunxi-ng/ccu_div.c
index a489f18a3c01..419463375bc1 100644
--- a/drivers/clk/sunxi-ng/ccu_div.c
+++ b/drivers/clk/sunxi-ng/ccu_div.c
@@ -20,18 +20,11 @@ static unsigned long ccu_div_round_rate(struct ccu_mux_internal *mux,
 					void *data)
 {
 	struct ccu_div *cd = data;
-	unsigned long val;
-
-	/*
-	 * We can't use divider_round_rate that assumes that there's
-	 * several parents, while we might be called to evaluate
-	 * several different parents.
-	 */
-	val = divider_get_val(rate, *parent_rate, cd->div.table, cd->div.width,
-			      cd->div.flags);
 
-	return divider_recalc_rate(&cd->common.hw, *parent_rate, val,
-				   cd->div.table, cd->div.flags);
+	return divider_round_rate_parent(&cd->common.hw, parent,
+					 rate, parent_rate,
+					 cd->div.table, cd->div.width,
+					 cd->div.flags);
 }
 
 static void ccu_div_disable(struct clk_hw *hw)
@@ -78,18 +71,6 @@ static int ccu_div_determine_rate(struct clk_hw *hw,
 {
 	struct ccu_div *cd = hw_to_ccu_div(hw);
 
-	if (clk_hw_get_num_parents(hw) == 1) {
-		req->rate = divider_round_rate(hw, req->rate,
-					       &req->best_parent_rate,
-					       cd->div.table,
-					       cd->div.width,
-					       cd->div.flags);
-
-		req->best_parent_hw = clk_hw_get_parent(hw);
-
-		return 0;
-	}
-
 	return ccu_mux_helper_determine_rate(&cd->common, &cd->mux,
 					     req, ccu_div_round_rate, cd);
 }
-- 
git-series 0.8.11

[toc] | [next] | [standalone]


#1635393

FromChen-Yu Tsai <wens@csie.org>
Date2017-05-04 05:30 +0200
Message-ID<tDfCO-6fm-13@gated-at.bofh.it>
In reply to#1634918
On Wed, May 3, 2017 at 7:59 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> divider_round_rate already evaluates changing the parent rate if

  ^^^ Might want to update this, as you are now using the new function
      you added in patch 1.

> CLK_SET_RATE_PARENT is set. Now that we can do that on muxes too, let's
> just use it.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Otherwise,

Acked-by: Chen-Yu Tsai <wens@csie.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web