diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-05-27 17:16:19 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2009-05-27 17:16:19 +0000 |
commit | a3e1607f859d79e67fcc0dcbdb33f807e4de09e8 (patch) | |
tree | 0d059a5b8a225eda089c097b5085f1c4cfccb0c5 /target/linux/ar71xx/files | |
parent | 12337afbafcb8a649ccf3ee6d9e749552e1329d6 (diff) | |
download | master-187ad058-a3e1607f859d79e67fcc0dcbdb33f807e4de09e8.tar.gz master-187ad058-a3e1607f859d79e67fcc0dcbdb33f807e4de09e8.tar.bz2 master-187ad058-a3e1607f859d79e67fcc0dcbdb33f807e4de09e8.zip |
[ar71xx] register SPI bus on the AP83 board
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16115 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c index df9421cc72..4ebdc61ce5 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap83.c @@ -11,6 +11,8 @@ #include <linux/platform_device.h> #include <linux/input.h> +#include <linux/spi/spi.h> +#include <linux/spi/spi_gpio.h> #include <asm/mips_machine.h> #include <asm/mach-ar71xx/ar71xx.h> @@ -23,6 +25,11 @@ #define AP83_GPIO_BTN_JUMPSTART 12 #define AP83_GPIO_BTN_RESET 21 +#define AP83_GPIO_VSC7385_CS 1 +#define AP83_GPIO_VSC7385_MISO 3 +#define AP83_GPIO_VSC7385_MOSI 16 +#define AP83_GPIO_VSC7385_SCK 17 + static struct gpio_led ap83_leds_gpio[] __initdata = { { .name = "ap83:green:jumpstart", @@ -57,6 +64,21 @@ static struct gpio_button ap83_gpio_buttons[] __initdata = { } }; +static struct spi_gpio_platform_data ap83_spi_data = { + .miso = AP83_GPIO_VSC7385_MISO, + .mosi = AP83_GPIO_VSC7385_MOSI, + .sck = AP83_GPIO_VSC7385_SCK, + .num_chipselect = 1, +}; + +static struct platform_device ap83_spi_device = { + .name = "spi_gpio", + .id = 0, + .dev = { + .platform_data = &ap83_spi_data, + } +}; + static void __init ap83_setup(void) { ar71xx_add_device_mdio(0xfffffffe); @@ -82,6 +104,8 @@ static void __init ap83_setup(void) ar71xx_add_device_usb(); ar91xx_add_device_wmac(); + + platform_device_register(&ap83_spi_device); } MIPS_MACHINE(AR71XX_MACH_AP83, "Atheros AP83", ap83_setup); |