diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/generic.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c index 12ea58a3b84f..b5aa49d00ca3 100644 --- a/arch/arm/mach-imx/generic.c +++ b/arch/arm/mach-imx/generic.c | |||
@@ -104,6 +104,9 @@ EXPORT_SYMBOL(imx_gpio_mode); | |||
104 | */ | 104 | */ |
105 | static unsigned int imx_decode_pll(unsigned int pll) | 105 | static unsigned int imx_decode_pll(unsigned int pll) |
106 | { | 106 | { |
107 | unsigned long long ll; | ||
108 | unsigned long quot; | ||
109 | |||
107 | u32 mfi = (pll >> 10) & 0xf; | 110 | u32 mfi = (pll >> 10) & 0xf; |
108 | u32 mfn = pll & 0x3ff; | 111 | u32 mfn = pll & 0x3ff; |
109 | u32 mfd = (pll >> 16) & 0x3ff; | 112 | u32 mfd = (pll >> 16) & 0x3ff; |
@@ -112,7 +115,11 @@ static unsigned int imx_decode_pll(unsigned int pll) | |||
112 | 115 | ||
113 | mfi = mfi <= 5 ? 5 : mfi; | 116 | mfi = mfi <= 5 ? 5 : mfi; |
114 | 117 | ||
115 | return (2 * (f_ref>>10) * ( (mfi<<10) + (mfn<<10) / (mfd+1) )) / (pd+1); | 118 | ll = 2 * (unsigned long long)f_ref * ( (mfi<<16) + (mfn<<16) / (mfd+1) ); |
119 | quot = (pd+1) * (1<<16); | ||
120 | ll += quot / 2; | ||
121 | do_div(ll, quot); | ||
122 | return (unsigned int) ll; | ||
116 | } | 123 | } |
117 | 124 | ||
118 | unsigned int imx_get_system_clk(void) | 125 | unsigned int imx_get_system_clk(void) |