[PATCH 2/3] pxa2xx/cpufreq: Simplify DRI recomputation routine
Marek Vasut
marek.vasut at gmail.com
Thu Jun 24 09:57:12 EDT 2010
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 at gmail.com>
---
arch/arm/mach-pxa/cpufreq-pxa2xx.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 9e4d981..bb5f21e 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -256,12 +256,13 @@ static void init_sdram_rows(void)
static u32 mdrefr_dri(unsigned int freq)
{
- u32 dri = 0;
+ u32 dri = 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;
+ dri -= 31;
+
+ dri /= 32;
+
return dri;
}
--
1.7.1
More information about the linux-arm-kernel
mailing list