diff options
Diffstat (limited to 'arch/arm/mach-sa1100/jornada720_ssp.c')
-rw-r--r-- | arch/arm/mach-sa1100/jornada720_ssp.c | 60 |
1 files changed, 37 insertions, 23 deletions
diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c index 395c39bed7d823..7ab256ac0aee78 100644 --- a/arch/arm/mach-sa1100/jornada720_ssp.c +++ b/arch/arm/mach-sa1100/jornada720_ssp.c @@ -24,6 +24,8 @@ #include <asm/hardware/ssp.h> #include <asm/arch/jornada720.h> +#define SA1100_PPDR_LFCLK 0x400 + static DEFINE_SPINLOCK(jornada_ssp_lock); static unsigned long jornada_ssp_flags; @@ -44,7 +46,7 @@ u8 inline jornada_ssp_reverse(u8 byte) ((0x04 & byte) << 3) | ((0x02 & byte) << 5) | ((0x01 & byte) << 7); -}; +} EXPORT_SYMBOL(jornada_ssp_reverse); /** @@ -75,7 +77,7 @@ int jornada_ssp_byte(u8 byte) ssp_read_word(&ret); return jornada_ssp_reverse(ret); -}; +} EXPORT_SYMBOL(jornada_ssp_byte); /** @@ -130,27 +132,38 @@ int jornada_ssp_end() }; EXPORT_SYMBOL(jornada_ssp_end); -static int __init jornada_ssp_probe(struct platform_device *dev) +static int __init jornada_ssp_probe(struct platform_device *pdev) { int ret; - GPSR = GPIO_GPIO25; - +#ifdef CONFIG_SA1100_JORNADA720_FLASHROM + printk(KERN_INFO "SSP: Resetting SSP bus\n"); + PPSR &= (SA1100_PPDR_LFCLK | 0x80 | 0x10); + udelay(500); + + PPDR |= (SA1100_PPDR_LFCLK | 0x80 | 0x10); + udelay(500); + + PPSR |= SA1100_PPDR_LFCLK; + udelay(500); + + /* init of Serial 4 port */ + GPSR = 0x02000000; + GPDR |= 0x02000000; + Ser4SSCR0 = 0x0307; + Ser4MCCR0 = 0; + Ser4SSSR = 0; + Ser4SSCR1 = 0x18; + Ser4SSCR0 = 0x0387; +#endif + ret = ssp_init(); - - /* worked fine, lets not bother with anything else */ + if (!ret) { printk(KERN_INFO "SSP: device initialized with irq\n"); return ret; } - - printk(KERN_WARNING "SSP: initialization failed, trying non-irq solution \n"); - - /* init of Serial 4 port */ - Ser4MCCR0 = 0; - Ser4SSCR0 = 0x0387; - Ser4SSCR1 = 0x18; - + /* clear out any left over data */ ssp_flush(); @@ -178,24 +191,25 @@ static int __init jornada_ssp_probe(struct platform_device *dev) return 0; }; -static int jornada_ssp_remove(struct platform_device *dev) +static int jornada_ssp_remove(struct platform_device *pdev) { - /* Note that this doesnt actually remove the driver, since theres nothing to remove - * It just makes sure everything is turned off */ GPSR = GPIO_GPIO25; ssp_exit(); return 0; }; -struct platform_driver jornadassp_driver = { - .probe = jornada_ssp_probe, - .remove = jornada_ssp_remove, - .driver = { - .name = "jornada_ssp", +static struct platform_driver jornadassp_driver = { + .driver = { + .name = "jornada_ssp", }, + .probe = jornada_ssp_probe, + .remove = __devexit_p(jornada_ssp_remove), }; static int __init jornada_ssp_init(void) { + printk(KERN_INFO "jornada720_ssp.c: Entering function\n"); return platform_driver_register(&jornadassp_driver); } + +module_init(jornada_ssp_init); |