Commit 23300597 authored by Kai Svahn's avatar Kai Svahn Committed by Tony Lindgren

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: default avatarKai Svahn <kai.svahn@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent c1ed6407
...@@ -111,6 +111,13 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns) ...@@ -111,6 +111,13 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
return (time_ns * 1000 + tick_ps - 1) / tick_ps; return (time_ns * 1000 + tick_ps - 1) / tick_ps;
} }
unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns)
{
unsigned long ticks = gpmc_ns_to_ticks(time_ns);
return ticks * gpmc_get_fclk_period() / 1000;
}
#ifdef DEBUG #ifdef DEBUG
static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
int time, const char *name) int time, const char *name)
......
...@@ -81,6 +81,8 @@ struct gpmc_timings { ...@@ -81,6 +81,8 @@ struct gpmc_timings {
}; };
extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
extern unsigned long gpmc_get_fclk_period(void);
extern void gpmc_cs_write_reg(int cs, int idx, u32 val); extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
extern u32 gpmc_cs_read_reg(int cs, int idx); extern u32 gpmc_cs_read_reg(int cs, int idx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment