Skip to content

Commit

Permalink
[ARM] pxa: cpufreq-pxa2xx: fix DRI recomputation routine
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marek Vasut authored and Eric Miao committed Aug 5, 2010
1 parent 5852984 commit 0357ae8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/arm/mach-pxa/cpufreq-pxa2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 0357ae8

Please sign in to comment.