1 Index: linux-3.1/arch/mips/lantiq/devices.c
2 ===================================================================
3 --- linux-3.1.orig/arch/mips/lantiq/devices.c 2011-11-12 18:06:54.712192370 +0100
4 +++ linux-3.1/arch/mips/lantiq/devices.c 2011-11-12 18:06:55.544192390 +0100
6 #include <linux/time.h>
8 #include <linux/gpio.h>
9 +#include <linux/dma-mapping.h>
11 #include <asm/bootinfo.h>
14 pr_err("kernel is compiled without PCI support\n");
18 +static unsigned int *cp1_base = 0;
20 +ltq_get_cp1_base(void)
24 +EXPORT_SYMBOL(ltq_get_cp1_base);
27 +ltq_register_tapi(void)
29 +#define CP1_SIZE (1 << 20)
32 + (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
34 Index: linux-3.1/arch/mips/lantiq/devices.h
35 ===================================================================
36 --- linux-3.1.orig/arch/mips/lantiq/devices.h 2011-11-12 18:06:54.712192370 +0100
37 +++ linux-3.1/arch/mips/lantiq/devices.h 2011-11-12 18:06:55.544192390 +0100
39 extern void ltq_register_wdt(void);
40 extern void ltq_register_asc(int port);
41 extern void ltq_register_pci(struct ltq_pci_data *data);
42 +extern void ltq_register_tapi(void);
45 Index: linux-3.1/arch/mips/lantiq/xway/Makefile
46 ===================================================================
47 --- linux-3.1.orig/arch/mips/lantiq/xway/Makefile 2011-11-12 18:06:55.520192389 +0100
48 +++ linux-3.1/arch/mips/lantiq/xway/Makefile 2011-11-12 18:06:55.544192390 +0100
50 obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o nand.o timer.o
52 +obj-y += dev-dwc_otg.o
54 obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o
55 obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o
56 obj-$(CONFIG_SOC_VR9) += clk-vr9.o prom-vr9.o
57 Index: linux-3.1/arch/mips/lantiq/xway/devices.c
58 ===================================================================
59 --- linux-3.1.orig/arch/mips/lantiq/xway/devices.c 2011-11-12 18:06:55.304192384 +0100
60 +++ linux-3.1/arch/mips/lantiq/xway/devices.c 2011-11-12 18:06:55.544192390 +0100
62 #include <linux/time.h>
64 #include <linux/gpio.h>
65 +#include <linux/spi/spi.h>
67 #include <asm/bootinfo.h>
70 platform_device_register(<q_etop);
75 +int lantiq_emulate_madwifi_eep = 0;
76 +EXPORT_SYMBOL(lantiq_emulate_madwifi_eep);
78 +int lantiq_madwifi_eep_addr = 0;
79 +EXPORT_SYMBOL(lantiq_madwifi_eep_addr);
82 +ltq_register_madwifi_eep(unsigned long long addr)
84 + lantiq_madwifi_eep_addr = addr;
85 + lantiq_emulate_madwifi_eep = 1;
89 +static struct resource ltq_ebu_resource =
92 + .start = LTQ_EBU_GPIO_START,
93 + .end = LTQ_EBU_GPIO_START + LTQ_EBU_GPIO_SIZE - 1,
94 + .flags = IORESOURCE_MEM,
97 +static struct platform_device ltq_ebu =
100 + .resource = <q_ebu_resource,
101 + .num_resources = 1,
105 +ltq_register_gpio_ebu(unsigned int value)
107 + ltq_ebu.dev.platform_data = (void*) value;
108 + platform_device_register(<q_ebu);
112 +static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data;
114 +static struct platform_device ltq_gpio_buttons_platform_device =
116 + .name = "gpio-buttons",
119 + .platform_data = (void *) <q_gpio_buttons_platform_data,
124 +ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt)
126 + ltq_gpio_buttons_platform_data.buttons = buttons;
127 + ltq_gpio_buttons_platform_data.nbuttons = cnt;
128 + platform_device_register(<q_gpio_buttons_platform_device);
131 +static struct resource ltq_spi_resources[] = {
133 + .start = LTQ_SSC_BASE_ADDR,
134 + .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
135 + .flags = IORESOURCE_MEM,
137 + IRQ_RES(spi_tx, LTQ_SSC_TIR),
138 + IRQ_RES(spi_rx, LTQ_SSC_RIR),
139 + IRQ_RES(spi_err, LTQ_SSC_EIR),
142 +static struct resource ltq_spi_resources_ar9[] = {
144 + .start = LTQ_SSC_BASE_ADDR,
145 + .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
146 + .flags = IORESOURCE_MEM,
148 + IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9),
149 + IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9),
150 + IRQ_RES(spi_err, LTQ_SSC_EIR),
153 +static struct platform_device ltq_spi = {
155 + .resource = ltq_spi_resources,
156 + .num_resources = ARRAY_SIZE(ltq_spi_resources),
159 +void __init ltq_register_spi(struct ltq_spi_platform_data *pdata,
160 + struct spi_board_info const *info, unsigned n)
163 + ltq_spi.resource = ltq_spi_resources_ar9;
164 + spi_register_board_info(info, n);
165 + ltq_spi.dev.platform_data = pdata;
166 + platform_device_register(<q_spi);
168 Index: linux-3.1/arch/mips/lantiq/xway/devices.h
169 ===================================================================
170 --- linux-3.1.orig/arch/mips/lantiq/xway/devices.h 2011-10-24 09:10:05.000000000 +0200
171 +++ linux-3.1/arch/mips/lantiq/xway/devices.h 2011-11-12 18:06:55.544192390 +0100
174 #include "../devices.h"
175 #include <linux/phy.h>
176 +#include <linux/spi/spi.h>
177 +#include <linux/gpio_buttons.h>
179 extern void ltq_register_gpio(void);
180 extern void ltq_register_gpio_stp(void);
181 extern void ltq_register_ase_asc(void);
182 extern void ltq_register_etop(struct ltq_eth_data *eth);
183 +extern void ltq_register_gpio_ebu(unsigned int value);
184 +extern void ltq_register_spi(struct ltq_spi_platform_data *pdata,
185 + struct spi_board_info const *info, unsigned n);
186 +extern void ltq_register_madwifi_eep(unsigned long long addr);
187 +extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt);
190 Index: linux-3.1/arch/mips/lantiq/Makefile
191 ===================================================================
192 --- linux-3.1.orig/arch/mips/lantiq/Makefile 2011-11-12 18:06:54.780192371 +0100
193 +++ linux-3.1/arch/mips/lantiq/Makefile 2011-11-12 19:52:32.700339384 +0100
195 # under the terms of the GNU General Public License version 2 as published
196 # by the Free Software Foundation.
198 -obj-y := irq.o setup.o clk.o prom.o devices.o
199 +obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-leds.o dev-gpio-buttons.o dev-wifi-rt2x00.o
201 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o