public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: "Komal Shah" <komal_shah802003@yahoo.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH] ARM: OMAP: Fix gpmc.c compilation
Date: Fri, 16 Jun 2006 04:35:04 -0700	[thread overview]
Message-ID: <1150457704.31515.263970479@webmail.messagingengine.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

This patch is compile tested only.

--Komal Shah
http://komalshah.blogspot.com

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again


[-- Attachment #2: 0001-fix-gpmc.patch --]
[-- Type: application/octet-stream, Size: 2092 bytes --]

From nobody Mon Sep 17 00:00:00 2001
From: Komal Shah <komal_shah802003@yahoo.com>
Date: Fri, 16 Jun 2006 22:30:10 +0530
Subject: [PATCH] ARM: OMAP: Fix gpmc.c compilation when DEBUG is

enabled and add gpmc_get_clk_period.
Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>

---

 arch/arm/mach-omap2/gpmc.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

02c467de7150113d6c84cb8d6b21ad6c63f272a1
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 4aeaa4e..34cdaf8 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -71,6 +71,12 @@ u32 gpmc_cs_read_reg(int cs, int idx)
 	return __raw_readl(gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx);
 }
 
+static unsigned long gpmc_get_clk_period(int div)
+{
+	/* In picoseconds */
+	return 1000000000 / ((clk_get_rate(gpmc_l3_clk)/div) / 1000);
+}
+
 /* TODO: Add support for gpmc_fck to clock framework and use it */
 static unsigned long gpmc_get_fclk_period(void)
 {
@@ -93,7 +99,7 @@ static int set_gpmc_timing_reg(int cs, i
 			       int time, int div, const char *name)
 #else
 static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
-			       int time)
+			       int time, int div)
 #endif
 {
 	u32 l;
@@ -124,11 +130,11 @@ #endif
 #ifdef DEBUG
 #define GPMC_SET_ONE(reg, st, end, field) \
 	if (set_gpmc_timing_reg(cs, (reg), (st), (end),		\
-			t->field, #field) < 0)			\
+			t->field, div, #field) < 0)			\
 		return -1
 #else
 #define GPMC_SET_ONE(reg, st, end, field) \
-	if (set_gpmc_timing_reg(cs, (reg), (st), (end), t->field) < 0) \
+	if (set_gpmc_timing_reg(cs, (reg), (st), (end), t->field, div) < 0) \
 		return -1
 #endif
 
@@ -176,8 +182,8 @@ int gpmc_cs_set_timings(int cs, const st
 	GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access);
 
 #ifdef DEBUG
-	printk(KERN_INFO "GPMC CLK period is %d (div %d)\n",
-	       cs, get_gpmc_clk_period(div), div);
+	printk(KERN_INFO "GPMC CS%d: CLK period is %3lu (div %d)\n",
+	       cs, gpmc_get_clk_period(div), div);
 #endif
 
 	l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-- 
1.3.3


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2006-06-16 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-16 11:35 Komal Shah [this message]
2006-06-16 12:03 ` [PATCH] ARM: OMAP: Fix gpmc.c compilation Juha Yrjölä

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=1150457704.31515.263970479@webmail.messagingengine.com \
    --to=komal_shah802003@yahoo.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox