arm: mx5: clock: improve accuracy of decode_pll()
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Apr 2014 08:18:35 +0000 (10:18 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Apr 2014 08:18:35 +0000 (10:18 +0200)
arch/arm/cpu/armv7/mx5/clock.c

index 7dec2d1..5091f99 100644 (file)
@@ -378,7 +378,6 @@ static uint32_t decode_pll(struct mxc_pll_reg *pll, uint32_t infreq)
        if (ctrl & MXC_DPLLC_CTL_DPDCK0_2_EN)
                refclk *= 2;
 
-       do_div(refclk, pdf + 1);
        temp = refclk * mfn_abs;
        do_div(temp, mfd + 1);
        ret = refclk * mfi;
@@ -388,6 +387,7 @@ static uint32_t decode_pll(struct mxc_pll_reg *pll, uint32_t infreq)
        else
                ret += temp;
 
+       ret /= pdf + 1;
        return ret;
 }