aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Svahn <kai.svahn@nokia.com>2007-01-26 15:29:40 -0500
committerTony Lindgren <tony@atomide.com>2007-09-20 12:59:26 -0400
commit23300597948131d07eebeb1308c2ba0a1c147494 (patch)
treef287e49b8c52c26659842e69c4e3beb9a924c669
parentc1ed6407cddbd87206b860f6207731d51c1d57bf (diff)
ARM: OMAP: Merge gpmc changes from N800 tree
This patch merges gpmc changes from N800 tree and adds gpmc_get_fclk_period() to gpmc.h. Signed-off-by: Kai Svahn <kai.svahn@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/gpmc.c7
-rw-r--r--include/asm-arm/arch-omap/gpmc.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 03595ee72ed3..5a4cc2076a7d 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -111,6 +111,13 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
111 return (time_ns * 1000 + tick_ps - 1) / tick_ps; 111 return (time_ns * 1000 + tick_ps - 1) / tick_ps;
112} 112}
113 113
114unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns)
115{
116 unsigned long ticks = gpmc_ns_to_ticks(time_ns);
117
118 return ticks * gpmc_get_fclk_period() / 1000;
119}
120
114#ifdef DEBUG 121#ifdef DEBUG
115static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, 122static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
116 int time, const char *name) 123 int time, const char *name)
diff --git a/include/asm-arm/arch-omap/gpmc.h b/include/asm-arm/arch-omap/gpmc.h
index 434672df702f..6a8e07ffc2d0 100644
--- a/include/asm-arm/arch-omap/gpmc.h
+++ b/include/asm-arm/arch-omap/gpmc.h
@@ -81,6 +81,8 @@ struct gpmc_timings {
81}; 81};
82 82
83extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); 83extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
84extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
85extern unsigned long gpmc_get_fclk_period(void);
84 86
85extern void gpmc_cs_write_reg(int cs, int idx, u32 val); 87extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
86extern u32 gpmc_cs_read_reg(int cs, int idx); 88extern u32 gpmc_cs_read_reg(int cs, int idx);