diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-05-27 17:10:00 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-05-27 17:10:00 +0000 |
commit | 7613c70c38e3433704e2b8cdfdd594d0f2383968 (patch) | |
tree | 8fe6e5ea1e439ea0538b20d170bd1638910e7107 /target/linux/ramips/files/arch/mips/ralink/rt3883/devices.c | |
parent | 948640b4ddf3103d93e1f98ac0318dd90766040c (diff) | |
download | master-187ad058-7613c70c38e3433704e2b8cdfdd594d0f2383968.tar.gz master-187ad058-7613c70c38e3433704e2b8cdfdd594d0f2383968.tar.bz2 master-187ad058-7613c70c38e3433704e2b8cdfdd594d0f2383968.zip |
ramips: rt3883: add device registration code for the SPI controller
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31922 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files/arch/mips/ralink/rt3883/devices.c')
-rw-r--r-- | target/linux/ramips/files/arch/mips/ralink/rt3883/devices.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt3883/devices.c b/target/linux/ramips/files/arch/mips/ralink/rt3883/devices.c index 8d394bb62e..c9863ab39b 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt3883/devices.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt3883/devices.c @@ -14,6 +14,7 @@ #include <linux/mtd/physmap.h> #include <linux/mtd/partitions.h> #include <linux/dma-mapping.h> +#include <linux/spi/spi.h> #include <linux/delay.h> #include <linux/err.h> #include <linux/clk.h> @@ -378,3 +379,25 @@ void __init rt3883_register_nand(void) { platform_device_register(&rt3883_nand_device); } + +static struct resource rt3883_spi_resources[] = { + { + .flags = IORESOURCE_MEM, + .start = RT3883_SPI_BASE, + .end = RT3883_SPI_BASE + RT3883_SPI_SIZE - 1, + }, +}; + +static struct platform_device rt3883_spi_device = { + .name = "ramips-spi", + .id = 0, + .resource = rt3883_spi_resources, + .num_resources = ARRAY_SIZE(rt3883_spi_resources), +}; + +void __init rt3883_register_spi(struct spi_board_info *info, int n) +{ + spi_register_board_info(info, n); + platform_device_register(&rt3883_spi_device); +} + |