diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2010-06-24 09:57:12 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-08-05 02:32:28 -0400 |
commit | 0357ae8f8cf460226e6b4167ce4350452ea68943 (patch) | |
tree | a5c1000d08d890d36ef87183d45c6a0c87062e6a /arch/arm/mach-pxa | |
parent | 5852984a8bf5fe028613467c11edbcae62ec43e7 (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/arm/mach-pxa')
-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) | |||
256 | 256 | ||
257 | static u32 mdrefr_dri(unsigned int freq) | 257 | static u32 mdrefr_dri(unsigned int freq) |
258 | { | 258 | { |
259 | u32 dri = 0; | 259 | u32 interval = freq * SDRAM_TREF / sdram_rows; |
260 | 260 | ||
261 | if (cpu_is_pxa25x()) | 261 | return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32; |
262 | dri = ((freq * SDRAM_TREF) / (sdram_rows * 32)); | ||
263 | if (cpu_is_pxa27x()) | ||
264 | dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32; | ||
265 | return dri; | ||
266 | } | 262 | } |
267 | 263 | ||
268 | /* find a valid frequency point */ | 264 | /* find a valid frequency point */ |