[ar71xx] add AR913x specific GPIO function bit definitions
[openwrt.git] / target / linux / ixp4xx / patches-2.6.30 / 310-gtwx5717_spi_bus.patch
1 --- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
2 +++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
3 @@ -29,6 +29,8 @@
4 #include <linux/serial_8250.h>
5 #include <linux/slab.h>
6
7 +#include <linux/spi/spi_gpio_old.h>
8 +
9 #include <asm/types.h>
10 #include <asm/setup.h>
11 #include <asm/memory.h>
12 @@ -121,9 +123,41 @@ static struct platform_device gtwx5715_f
13 .resource = &gtwx5715_flash_resource,
14 };
15
16 +static int gtwx5715_spi_boardinfo_setup(struct spi_board_info *bi,
17 + struct spi_master *master, void *data)
18 +{
19 +
20 + strlcpy(bi->modalias, "spi-ks8995", sizeof(bi->modalias));
21 +
22 + bi->max_speed_hz = 5000000 /* Hz */;
23 + bi->bus_num = master->bus_num;
24 + bi->mode = SPI_MODE_0;
25 +
26 + return 0;
27 +}
28 +
29 +static struct spi_gpio_platform_data gtwx5715_spi_bus_data = {
30 + .pin_cs = GTWX5715_KSSPI_SELECT,
31 + .pin_clk = GTWX5715_KSSPI_CLOCK,
32 + .pin_miso = GTWX5715_KSSPI_RXD,
33 + .pin_mosi = GTWX5715_KSSPI_TXD,
34 + .cs_activelow = 1,
35 + .no_spi_delay = 1,
36 + .boardinfo_setup = gtwx5715_spi_boardinfo_setup,
37 +};
38 +
39 +static struct platform_device gtwx5715_spi_bus = {
40 + .name = "spi-gpio",
41 + .id = 0,
42 + .dev = {
43 + .platform_data = &gtwx5715_spi_bus_data,
44 + },
45 +};
46 +
47 static struct platform_device *gtwx5715_devices[] __initdata = {
48 &gtwx5715_uart_device,
49 &gtwx5715_flash,
50 + &gtwx5715_spi_bus,
51 };
52
53 static void __init gtwx5715_init(void)
This page took 0.052169 seconds and 5 git commands to generate.