diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2010-06-24 15:57:12 +0200 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-07-13 16:09:06 +0800 |
commit | 3d3d0fbf4dca6bbca5e9ffff9653c3df031c3449 (patch) | |
tree | 91007207837f56f0c25ebc4fe18d1dc7986a0bb2 /arch | |
parent | 76d61e4ee05dd904e7594d4c330b9c47ea51fe12 (diff) |
[ARM] pxa: cpufreq-pxa2xx: fix DRI recomputation routine
This patch:
1) Simpifies the DRI recomputation routine by pulling out the common code
2) Fixes a bug in PXA27x DRI recomputation caused by incorrect parenthesis
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-pxa/cpufreq-pxa2xx.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 9e4d9816726a..268a9bc6be8a 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c @@ -256,13 +256,9 @@ static void init_sdram_rows(void) static u32 mdrefr_dri(unsigned int freq) { - u32 dri = 0; + u32 interval = freq * SDRAM_TREF / sdram_rows; - if (cpu_is_pxa25x()) - dri = ((freq * SDRAM_TREF) / (sdram_rows * 32)); - if (cpu_is_pxa27x()) - dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32; - return dri; + return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32; } /* find a valid frequency point */ |