diff options
author | Adrian Hunter <adrian.hunter@nokia.com> | 2011-02-07 10:46:59 +0200 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-02-17 15:44:45 -0800 |
commit | 3ad2d861362031dac8b2bba78a8f4c575300948f (patch) | |
tree | 24dbf3d99034234dac78b3c001eac5c8470d514b /arch/arm/mach-omap2/gpmc-onenand.c | |
parent | 1435ca0fc1a269f9496343e24223a0fc430aff7a (diff) | |
download | linux-3ad2d861362031dac8b2bba78a8f4c575300948f.tar.gz linux-3ad2d861362031dac8b2bba78a8f4c575300948f.tar.bz2 linux-3ad2d861362031dac8b2bba78a8f4c575300948f.zip |
OMAP: OneNAND: determine frequency in one place
OneNAND frequency is determined when calculating
GPMC timings. Return that value instead of determining it
again in the OMAP OneNAND driver.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/gpmc-onenand.c')
-rw-r--r-- | arch/arm/mach-omap2/gpmc-onenand.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c index 3a4307b8f7cf..46786a606e90 100644 --- a/arch/arm/mach-omap2/gpmc-onenand.c +++ b/arch/arm/mach-omap2/gpmc-onenand.c @@ -123,7 +123,7 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency, static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, void __iomem *onenand_base, - int freq) + int *freq_ptr) { struct gpmc_timings t; const int t_cer = 15; @@ -136,7 +136,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency; int first_time = 0, hf = 0, vhf = 0, sync_read = 0, sync_write = 0; int err, ticks_cez; - int cs = cfg->cs; + int cs = cfg->cs, freq = *freq_ptr; u32 reg; if (cfg->flags & ONENAND_SYNC_READ) { @@ -330,16 +330,18 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf, vhf); + *freq_ptr = freq; + return 0; } -static int gpmc_onenand_setup(void __iomem *onenand_base, int freq) +static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr) { struct device *dev = &gpmc_onenand_device.dev; /* Set sync timings in GPMC */ if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, - freq) < 0) { + freq_ptr) < 0) { dev_err(dev, "Unable to set synchronous mode\n"); return -EINVAL; } |