From b3177f4440b9e92e2229931356ac20b1d302a634 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Tue, 16 Oct 2007 12:51:22 +0200 Subject: [PATCH] at32_cf: Set up SMC timings properly The SMC configuration API has changed. The smc_set_configuration() function now takes timings in cycles, while there's a helper function smc_set_timing() which can set up the cycle numbers based on timings in nanoseconds. Use this new API to set up proper timings for the CompactFlash interface. Signed-off-by: Haavard Skinnemoen --- drivers/pcmcia/at32_cf.c | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/pcmcia/at32_cf.c b/drivers/pcmcia/at32_cf.c index 6123729..ebe1495 100644 --- a/drivers/pcmcia/at32_cf.c +++ b/drivers/pcmcia/at32_cf.c @@ -315,6 +315,21 @@ static int __init request_pin(struct platform_device *pdev, return pin; } +static struct smc_timing at32_cf_timing __initdata = { + .ncs_read_setup = 30, + .nrd_setup = 100, + .ncs_write_setup = 30, + .nwe_setup = 100, + + .ncs_read_pulse = 360, + .nrd_pulse = 290, + .ncs_write_pulse = 360, + .nwe_pulse = 290, + + .read_cycle = 420, + .write_cycle = 420, +}; + static int __init at32_cf_probe(struct platform_device *pdev) { struct at32_cf_socket *cf; @@ -408,18 +423,7 @@ static int __init at32_cf_probe(struct platform_device *pdev) } /* Setup SMC timings */ - cf->smc.ncs_read_setup = 30; - cf->smc.nrd_setup = 100; - cf->smc.ncs_write_setup = 30; - cf->smc.nwe_setup = 100; - - cf->smc.ncs_read_pulse = 360; - cf->smc.nrd_pulse = 290; - cf->smc.ncs_write_pulse = 360; - cf->smc.nwe_pulse = 290; - - cf->smc.read_cycle = 420; - cf->smc.write_cycle = 420; + smc_set_timing(&cf->smc, &at32_cf_timing); cf->smc.bus_width = 2; cf->smc.nrd_controlled = 1; -- 1.5.3.2