diff options
author | Phil Elwell <phil@raspberrypi.org> | 2017-05-15 19:35:04 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2017-06-03 00:41:49 +0200 |
commit | e45098d703fbb9a7b02eae581aadb684b31e0eec (patch) | |
tree | b132afa1028409d0435f8f350c563f0b534abb9e /drivers/clk/bcm | |
parent | Merge branch 'clk-bulk-get' into clk-next (diff) | |
download | linux-e45098d703fbb9a7b02eae581aadb684b31e0eec.tar.xz linux-e45098d703fbb9a7b02eae581aadb684b31e0eec.zip |
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>
Diffstat (limited to 'drivers/clk/bcm')
-rw-r--r-- | drivers/clk/bcm/clk-bcm2835.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 025853870619..7a35df6b45bd 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -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); } |