diff options
Diffstat (limited to 'arch/arm/plat-mxc/clock.c')
-rw-r--r-- | arch/arm/plat-mxc/clock.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c index 92e13566cd4..f653213b741 100644 --- a/arch/arm/plat-mxc/clock.c +++ b/arch/arm/plat-mxc/clock.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/string.h> | 39 | #include <linux/string.h> |
40 | 40 | ||
41 | #include <mach/clock.h> | 41 | #include <mach/clock.h> |
42 | #include <mach/hardware.h> | ||
42 | 43 | ||
43 | static LIST_HEAD(clocks); | 44 | static LIST_HEAD(clocks); |
44 | static DEFINE_MUTEX(clocks_mutex); | 45 | static DEFINE_MUTEX(clocks_mutex); |
@@ -363,12 +364,11 @@ unsigned long mxc_decode_pll(unsigned int reg_val, u32 freq) | |||
363 | 364 | ||
364 | mfn_abs = mfn; | 365 | mfn_abs = mfn; |
365 | 366 | ||
366 | #if !defined CONFIG_ARCH_MX1 && !defined CONFIG_ARCH_MX21 | 367 | /* On all i.MXs except i.MX1 and i.MX21 mfn is a 10bit |
367 | if (mfn >= 0x200) { | 368 | * 2's complements number |
368 | mfn |= 0xFFFFFE00; | 369 | */ |
369 | mfn_abs = -mfn; | 370 | if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200) |
370 | } | 371 | mfn_abs = 0x400 - mfn; |
371 | #endif | ||
372 | 372 | ||
373 | freq *= 2; | 373 | freq *= 2; |
374 | freq /= pd + 1; | 374 | freq /= pd + 1; |
@@ -376,8 +376,10 @@ unsigned long mxc_decode_pll(unsigned int reg_val, u32 freq) | |||
376 | ll = (unsigned long long)freq * mfn_abs; | 376 | ll = (unsigned long long)freq * mfn_abs; |
377 | 377 | ||
378 | do_div(ll, mfd + 1); | 378 | do_div(ll, mfd + 1); |
379 | if (mfn < 0) | 379 | |
380 | if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200) | ||
380 | ll = -ll; | 381 | ll = -ll; |
382 | |||
381 | ll = (freq * mfi) + ll; | 383 | ll = (freq * mfi) + ll; |
382 | 384 | ||
383 | return ll; | 385 | return ll; |