mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 17:41:22 +00:00
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: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
parent
887541159c
commit
e45098d703
@ -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) &
|
||||
data->ana->fb_prediv_mask;
|
||||
|
||||
if (using_prediv)
|
||||
if (using_prediv) {
|
||||
ndiv *= 2;
|
||||
fdiv *= 2;
|
||||
}
|
||||
|
||||
return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user