mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
clk: rockchip: Fix rk3036 pll rate overflow calculation on 32-bit
Change-Id: I4e367893e97828b01b3e6ec457714c722d2c0af6 Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
@@ -495,7 +495,7 @@ static unsigned long rockchip_rk3036_pll_recalc_rate(struct clk_hw *hw,
|
||||
{
|
||||
struct rockchip_clk_pll *pll = to_rockchip_clk_pll(hw);
|
||||
struct rockchip_pll_rate_table cur;
|
||||
u64 rate64 = prate;
|
||||
u64 rate64 = prate, frac_rate64 = prate;
|
||||
|
||||
if (pll->sel && pll->scaling)
|
||||
return pll->scaling;
|
||||
@@ -510,7 +510,7 @@ static unsigned long rockchip_rk3036_pll_recalc_rate(struct clk_hw *hw,
|
||||
|
||||
if (cur.dsmpd == 0) {
|
||||
/* fractional mode */
|
||||
u64 frac_rate64 = prate * cur.frac;
|
||||
frac_rate64 *= cur.frac;
|
||||
|
||||
do_div(frac_rate64, cur.refdiv);
|
||||
rate64 += frac_rate64 >> 24;
|
||||
|
||||
Reference in New Issue
Block a user