Commit b32a7cc6 authored by Guo Zeng's avatar Guo Zeng Committed by Michael Turquette

clk: atlas7: fix pll missed divide NR in fraction mode

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: default avatarGuo Zeng <guo.zeng@csr.com>
Signed-off-by: default avatarBarry Song <Baohua.Song@csr.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent cf8709ea
...@@ -358,6 +358,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw, ...@@ -358,6 +358,7 @@ static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
if (regctrl0 & SIRFSOC_ABPLL_CTRL0_SSEN) { if (regctrl0 & SIRFSOC_ABPLL_CTRL0_SSEN) {
rate = fin; rate = fin;
rate *= 1 << 24; rate *= 1 << 24;
do_div(rate, nr);
do_div(rate, (256 * ((ssdiv >> ssdepth) << ssdepth) do_div(rate, (256 * ((ssdiv >> ssdepth) << ssdepth)
+ (ssmod << ssdepth))); + (ssmod << ssdepth)));
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment