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