linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: ingenic: Fix recalc_rate for clocks with fixed divider
@ 2016-11-01  9:58 Paul Cercueil
  2016-12-08 23:17 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Cercueil @ 2016-11-01  9:58 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Harvey Hunt, Paul Burton,
	linux-clk, linux-kernel
  Cc: Maarten ter Huurne, Paul Cercueil

Previously, the clocks with a fixed divider would report their rate
as being the same as the one of their parent, independently of the
divider in use. This commit fixes this behaviour.

This went unnoticed as neither the jz4740 nor the jz4780 CGU code
have clocks with fixed dividers yet.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/clk/ingenic/cgu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/ingenic/cgu.c b/drivers/clk/ingenic/cgu.c
index e8248f9..eb9002c 100644
--- a/drivers/clk/ingenic/cgu.c
+++ b/drivers/clk/ingenic/cgu.c
@@ -328,6 +328,8 @@ ingenic_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
 		div *= clk_info->div.div;
 
 		rate /= div;
+	} else if (clk_info->type & CGU_CLK_FIXDIV) {
+		rate /= clk_info->fixdiv.div;
 	}
 
 	return rate;
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: ingenic: Fix recalc_rate for clocks with fixed divider
  2016-11-01  9:58 [PATCH] clk: ingenic: Fix recalc_rate for clocks with fixed divider Paul Cercueil
@ 2016-12-08 23:17 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2016-12-08 23:17 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Michael Turquette, Harvey Hunt, Paul Burton, linux-clk,
	linux-kernel, Maarten ter Huurne

On 11/01, Paul Cercueil wrote:
> Previously, the clocks with a fixed divider would report their rate
> as being the same as the one of their parent, independently of the
> divider in use. This commit fixes this behaviour.
> 
> This went unnoticed as neither the jz4740 nor the jz4780 CGU code
> have clocks with fixed dividers yet.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---

Nobody replied or reviewed it so I'll bite. Do we have a user of
this code path? If not, please reserve this patch until such a
time and then include it in the series.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-08 23:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01  9:58 [PATCH] clk: ingenic: Fix recalc_rate for clocks with fixed divider Paul Cercueil
2016-12-08 23:17 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).