提交 e45098d7 编写于 作者: P Phil Elwell 提交者: Stephen Boyd

clk: bcm2835: Correct the prediv logic

If a clock has the prediv flag set, both the integer and fractional
parts must be scaled when calculating the resulting frequency.
Signed-off-by: NPhil Elwell <phil@raspberrypi.org>
Signed-off-by: NEric Anholt <eric@anholt.net>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 88754115
...@@ -616,8 +616,10 @@ static unsigned long bcm2835_pll_get_rate(struct clk_hw *hw, ...@@ -616,8 +616,10 @@ static unsigned long bcm2835_pll_get_rate(struct clk_hw *hw,
using_prediv = cprman_read(cprman, data->ana_reg_base + 4) & using_prediv = cprman_read(cprman, data->ana_reg_base + 4) &
data->ana->fb_prediv_mask; data->ana->fb_prediv_mask;
if (using_prediv) if (using_prediv) {
ndiv *= 2; ndiv *= 2;
fdiv *= 2;
}
return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv); return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册