diff options
author | Andrew Lunn <andrew@lunn.ch> | 2011-05-15 13:32:46 +0200 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-05-16 15:09:07 -0400 |
commit | 980f9f601ad456dc5a699bf526b6bd894957bad3 (patch) | |
tree | f5e1bd57495bf3dabc17eadd4eda8a36d14637b9 /arch/arm/plat-orion | |
parent | aac7ffa3ed121846b61347028828617c5dd1ce46 (diff) | |
download | kernel_goldelico_gta04-980f9f601ad456dc5a699bf526b6bd894957bad3.zip kernel_goldelico_gta04-980f9f601ad456dc5a699bf526b6bd894957bad3.tar.gz kernel_goldelico_gta04-980f9f601ad456dc5a699bf526b6bd894957bad3.tar.bz2 |
ARM: orion: Consolidate SPI initialization.
This change removes the interrupt resource. The driver does not use
it.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/plat-orion')
-rw-r--r-- | arch/arm/plat-orion/common.c | 47 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/common.h | 6 |
2 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index bcc1734..2afe79d 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c @@ -17,6 +17,7 @@ #include <linux/mv643xx_eth.h> #include <linux/mv643xx_i2c.h> #include <net/dsa.h> +#include <linux/spi/orion_spi.h> /* Fill in the resources structure and link it into the platform device structure. There is always a memory region, and nearly @@ -517,3 +518,49 @@ void __init orion_i2c_1_init(unsigned long mapbase, SZ_32 - 1, irq); platform_device_register(&orion_i2c_1); } + +/***************************************************************************** + * SPI + ****************************************************************************/ +static struct orion_spi_info orion_spi_plat_data; +static struct resource orion_spi_resources; + +static struct platform_device orion_spi = { + .name = "orion_spi", + .id = 0, + .dev = { + .platform_data = &orion_spi_plat_data, + }, +}; + +static struct orion_spi_info orion_spi_1_plat_data; +static struct resource orion_spi_1_resources; + +static struct platform_device orion_spi_1 = { + .name = "orion_spi", + .id = 1, + .dev = { + .platform_data = &orion_spi_1_plat_data, + }, +}; + +/* Note: The SPI silicon core does have interrupts. However the + * current Linux software driver does not use interrupts. */ + +void __init orion_spi_init(unsigned long mapbase, + unsigned long tclk) +{ + orion_spi_plat_data.tclk = tclk; + fill_resources(&orion_spi, &orion_spi_resources, + mapbase, SZ_512 - 1, NO_IRQ); + platform_device_register(&orion_spi); +} + +void __init orion_spi_1_init(unsigned long mapbase, + unsigned long tclk) +{ + orion_spi_1_plat_data.tclk = tclk; + fill_resources(&orion_spi_1, &orion_spi_1_resources, + mapbase, SZ_512 - 1, NO_IRQ); + platform_device_register(&orion_spi_1); +} diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h index d107c62..e72c146 100644 --- a/arch/arm/plat-orion/include/plat/common.h +++ b/arch/arm/plat-orion/include/plat/common.h @@ -73,4 +73,10 @@ void __init orion_i2c_init(unsigned long mapbase, void __init orion_i2c_1_init(unsigned long mapbase, unsigned long irq, unsigned long freq_m); + +void __init orion_spi_init(unsigned long mapbase, + unsigned long tclk); + +void __init orion_spi_1_init(unsigned long mapbase, + unsigned long tclk); #endif |