OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | --- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c |
2 | +++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c |
||
3 | @@ -27,6 +27,8 @@ |
||
4 | #include <linux/serial.h> |
||
5 | #include <linux/tty.h> |
||
6 | #include <linux/serial_8250.h> |
||
7 | +#include <linux/spi/spi.h> |
||
8 | +#include <linux/spi/spi_gpio.h> |
||
9 | #include <asm/types.h> |
||
10 | #include <asm/setup.h> |
||
11 | #include <asm/memory.h> |
||
12 | @@ -146,9 +148,37 @@ static struct platform_device gtwx5715_f |
||
13 | .resource = >wx5715_flash_resource, |
||
14 | }; |
||
15 | |||
16 | +static struct spi_gpio_platform_data gtwx5715_spi_platform_data = { |
||
17 | + .sck = GTWX5715_KSSPI_CLOCK, |
||
18 | + .mosi = GTWX5715_KSSPI_TXD, |
||
19 | + .miso = GTWX5715_KSSPI_RXD, |
||
20 | + .num_chipselect = 1, |
||
21 | +}; |
||
22 | + |
||
23 | +static struct platform_device gtwx5715_spi_device = { |
||
24 | + .name = "spi_gpio", |
||
25 | + .id = 1, |
||
26 | + .dev = { |
||
27 | + .platform_data = >wx5715_spi_platform_data, |
||
28 | + } |
||
29 | +}; |
||
30 | + |
||
31 | +static struct spi_board_info gtwx5715_spi_devices[] __initdata = { |
||
32 | + { |
||
33 | + .modalias = "spi-ks8995", |
||
34 | + .max_speed_hz = 5000000, |
||
35 | + .mode = SPI_MODE_0, |
||
36 | + .bus_num = 1, |
||
37 | + .chip_select = 0, |
||
38 | + .controller_data = (void *)GTWX5715_KSSPI_SELECT, |
||
39 | + } |
||
40 | +}; |
||
41 | + |
||
42 | + |
||
43 | static struct platform_device *gtwx5715_devices[] __initdata = { |
||
44 | >wx5715_uart_device, |
||
45 | >wx5715_flash, |
||
46 | + >wx5715_spi_device, |
||
47 | }; |
||
48 | |||
49 | static void __init gtwx5715_init(void) |
||
50 | @@ -158,6 +188,7 @@ static void __init gtwx5715_init(void) |
||
51 | gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); |
||
52 | gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; |
||
53 | |||
54 | + spi_register_board_info(gtwx5715_spi_devices, ARRAY_SIZE(gtwx5715_spi_devices)); |
||
55 | platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices)); |
||
56 | } |
||
57 |