All of lore.kernel.org
 help / color / mirror / Atom feed
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] pxa2xx/cpufreq: Simplify DRI recomputation routine
Date: Fri, 18 Jun 2010 07:48:53 +0200	[thread overview]
Message-ID: <1276840135-5982-2-git-send-email-marek.vasut@gmail.com> (raw)
In-Reply-To: <1276840135-5982-1-git-send-email-marek.vasut@gmail.com>

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>
---
 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 1949850..74fc4b5 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

  reply	other threads:[~2010-06-18  5:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-18  5:48 [PATCH 1/4] pxa2xx/cpufreq: Simplify CPU frequency change asm Marek Vasut
2010-06-18  5:48 ` Marek Vasut [this message]
2010-06-22 18:33   ` [PATCH 2/4] pxa2xx/cpufreq: Simplify DRI recomputation routine Robert Jarzmik
2010-06-18  5:48 ` [PATCH 3/4] pxa2xx/cpufreq: Fix PCMCIA frequency scaling Marek Vasut
2010-06-23 17:49   ` Robert Jarzmik
2010-06-24 18:51     ` Marek Vasut
2010-06-24 19:12       ` Russell King - ARM Linux
2010-06-24 19:33         ` Marek Vasut
2010-06-24 19:46         ` Nicolas Pitre
2010-06-28  4:48           ` Eric Miao
2010-06-18  5:48 ` [PATCH 4/4] pxa2xx/pcmcia: Prepare for pxa320 Marek Vasut
2010-06-23 19:00 ` [PATCH 1/4] pxa2xx/cpufreq: Simplify CPU frequency change asm Robert Jarzmik
2010-06-24  3:17   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1276840135-5982-2-git-send-email-marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.