1 Index: linux-3.0.3/arch/mips/lantiq/devices.c
2 ===================================================================
3 --- linux-3.0.3.orig/arch/mips/lantiq/devices.c 2011-10-04 20:03:54.000000000 +0200
4 +++ linux-3.0.3/arch/mips/lantiq/devices.c 2011-10-04 20:07:28.514316826 +0200
7 #include <linux/gpio.h>
8 #include <linux/leds.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.0.3/arch/mips/lantiq/devices.h
35 ===================================================================
36 --- linux-3.0.3.orig/arch/mips/lantiq/devices.h 2011-10-04 20:03:54.000000000 +0200
37 +++ linux-3.0.3/arch/mips/lantiq/devices.h 2011-10-04 20:07:13.362316180 +0200
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.0.3/arch/mips/lantiq/xway/Makefile
46 ===================================================================
47 --- linux-3.0.3.orig/arch/mips/lantiq/xway/Makefile 2011-10-04 20:07:01.000000000 +0200
48 +++ linux-3.0.3/arch/mips/lantiq/xway/Makefile 2011-10-04 20:07:13.362316180 +0200
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.0.3/arch/mips/lantiq/xway/devices.c
58 ===================================================================
59 --- linux-3.0.3.orig/arch/mips/lantiq/xway/devices.c 2011-10-04 20:05:44.000000000 +0200
60 +++ linux-3.0.3/arch/mips/lantiq/xway/devices.c 2011-10-04 20:07:44.070317494 +0200
63 #include <linux/gpio.h>
64 #include <linux/leds.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);
79 +ltq_register_madwifi_eep(void)
81 + lantiq_emulate_madwifi_eep = 1;
85 +static struct resource ltq_ebu_resource =
88 + .start = LTQ_EBU_GPIO_START,
89 + .end = LTQ_EBU_GPIO_START + LTQ_EBU_GPIO_SIZE - 1,
90 + .flags = IORESOURCE_MEM,
93 +static struct platform_device ltq_ebu =
96 + .resource = <q_ebu_resource,
101 +ltq_register_gpio_ebu(unsigned int value)
103 + ltq_ebu.dev.platform_data = (void*) value;
104 + platform_device_register(<q_ebu);
108 +static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data;
110 +static struct platform_device ltq_gpio_buttons_platform_device =
112 + .name = "gpio-buttons",
115 + .platform_data = (void *) <q_gpio_buttons_platform_data,
120 +ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt)
122 + ltq_gpio_buttons_platform_data.buttons = buttons;
123 + ltq_gpio_buttons_platform_data.nbuttons = cnt;
124 + platform_device_register(<q_gpio_buttons_platform_device);
127 +static struct resource ltq_spi_resources[] = {
129 + .start = LTQ_SSC_BASE_ADDR,
130 + .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
131 + .flags = IORESOURCE_MEM,
133 + IRQ_RES(spi_tx, LTQ_SSC_TIR),
134 + IRQ_RES(spi_rx, LTQ_SSC_RIR),
135 + IRQ_RES(spi_err, LTQ_SSC_EIR),
138 +static struct resource ltq_spi_resources_ar9[] = {
140 + .start = LTQ_SSC_BASE_ADDR,
141 + .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1,
142 + .flags = IORESOURCE_MEM,
144 + IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9),
145 + IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9),
146 + IRQ_RES(spi_err, LTQ_SSC_EIR),
149 +static struct platform_device ltq_spi = {
151 + .resource = ltq_spi_resources,
152 + .num_resources = ARRAY_SIZE(ltq_spi_resources),
155 +void __init ltq_register_spi(struct ltq_spi_platform_data *pdata,
156 + struct spi_board_info const *info, unsigned n)
159 + ltq_spi.resource = ltq_spi_resources_ar9;
160 + spi_register_board_info(info, n);
161 + ltq_spi.dev.platform_data = pdata;
162 + platform_device_register(<q_spi);
164 Index: linux-3.0.3/arch/mips/lantiq/xway/devices.h
165 ===================================================================
166 --- linux-3.0.3.orig/arch/mips/lantiq/xway/devices.h 2011-08-17 19:57:16.000000000 +0200
167 +++ linux-3.0.3/arch/mips/lantiq/xway/devices.h 2011-10-04 20:07:13.366316178 +0200
170 #include "../devices.h"
171 #include <linux/phy.h>
172 +#include <linux/spi/spi.h>
173 +#include <linux/gpio_buttons.h>
175 extern void ltq_register_gpio(void);
176 extern void ltq_register_gpio_stp(void);
177 extern void ltq_register_ase_asc(void);
178 extern void ltq_register_etop(struct ltq_eth_data *eth);
179 +extern void ltq_register_gpio_ebu(unsigned int value);
180 +extern void ltq_register_spi(struct ltq_spi_platform_data *pdata,
181 + struct spi_board_info const *info, unsigned n);
182 +extern void ltq_register_madwifi_eep(void);
183 +extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt);
186 Index: linux-3.0.3/arch/mips/lantiq/Makefile
187 ===================================================================
188 --- linux-3.0.3.orig/arch/mips/lantiq/Makefile 2011-10-04 20:03:54.000000000 +0200
189 +++ linux-3.0.3/arch/mips/lantiq/Makefile 2011-10-04 20:08:10.406318621 +0200
191 # under the terms of the GNU General Public License version 2 as published
192 # by the Free Software Foundation.
194 -obj-y := irq.o setup.o clk.o prom.o devices.o
195 +obj-y := irq.o setup.o clk.o prom.o devices.o dev-leds-gpio.o dev-gpio-buttons.o
197 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o