All of lore.kernel.org
 help / color / mirror / Atom feed
From: 21cnbao@gmail.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/7] clk: atlas7: fix pll missed divide NR in fraction mode
Date: Tue, 28 Jul 2015 06:27:25 +0000	[thread overview]
Message-ID: <1438064845-17894-8-git-send-email-21cnbao@gmail.com> (raw)
In-Reply-To: <1438064845-17894-1-git-send-email-21cnbao@gmail.com>

From: Guo Zeng <guo.zeng@csr.com>

PLL VCO frequency is given by Fvco = Fref * 2 * NF / NR
in integer-N mode, or by Fvco = Fref * SSN / NR in Spread
Spectrum (fractional-N) mode. Thus fix the missing part
of NR

Signed-off-by: Guo Zeng <guo.zeng@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/clk/sirf/clk-atlas7.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/sirf/clk-atlas7.c b/drivers/clk/sirf/clk-atlas7.c
index 4fc33da..19f417c 100644
--- a/drivers/clk/sirf/clk-atlas7.c
+++ b/drivers/clk/sirf/clk-atlas7.c
@@ -358,6 +358,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
 	if (regctrl0 & SIRFSOC_ABPLL_CTRL0_SSEN) {
 		rate = fin;
 		rate *= 1 << 24;
+		do_div(rate, nr);
 		do_div(rate, (256 * ((ssdiv >> ssdepth) << ssdepth)
 			+ (ssmod << ssdepth)));
 	} else {
-- 
1.9.1

  parent reply	other threads:[~2015-07-28  6:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28  6:27 [PATCH 0/7] clk: atlas7: a bind of fixes Barry Song
2015-07-28  6:27 ` [PATCH 1/7] clk: atlas7: add lost pwm unit clks Barry Song
2015-07-28  6:27 ` [PATCH 2/7] clk: atlas7: export mux clks so that driver can use it Barry Song
2015-07-28 21:56   ` Stephen Boyd
2015-07-29 12:24     ` Barry Song
2015-07-28  6:27 ` [PATCH 3/7] clk: sirf: fix integer overflow in dto rate calculation Barry Song
2015-07-28  6:27 ` [PATCH 4/7] clk: atlas7: replace dto resolution magic number by macro Barry Song
2015-07-28  6:27 ` [PATCH 5/7] clk: atlas7: fix the clock tree for bluetooth stuff Barry Song
2015-07-28 22:07   ` Stephen Boyd
2015-07-29 14:52     ` Barry Song
2015-08-06  1:44       ` Stephen Boyd
2015-08-06  9:53         ` Barry Song
2015-08-10  2:35         ` Barry Song
2015-08-12  0:02           ` Stephen Boyd
2015-08-12  2:39             ` Barry Song
2015-07-28  6:27 ` [PATCH 6/7] clk: sirf: fix bit field and its root clk for coresight_tpiu Barry Song
2015-07-28  6:27 ` Barry Song [this message]
2015-08-04 14:45 [PATCH 0/7 v2] clk: atlas7: a bind of fixes Barry Song
2015-08-04 14:45 ` [PATCH 7/7] clk: atlas7: fix pll missed divide NR in fraction mode Barry Song
2015-08-12  0:30   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438064845-17894-8-git-send-email-21cnbao@gmail.com \
    --to=21cnbao@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.