1 Index: linux-2.6.38-rc6/arch/arm/mach-omap2/board-n8x0.c
2 ===================================================================
3 --- linux-2.6.38-rc6.orig/arch/arm/mach-omap2/board-n8x0.c 2011-02-24 12:09:31.427080051 +0100
4 +++ linux-2.6.38-rc6/arch/arm/mach-omap2/board-n8x0.c 2011-02-24 12:09:59.754956253 +0100
6 #include <linux/delay.h>
7 #include <linux/gpio.h>
8 #include <linux/init.h>
9 +#include <linux/irq.h>
11 #include <linux/stddef.h>
12 +#include <linux/platform_device.h>
13 #include <linux/i2c.h>
14 #include <linux/spi/spi.h>
15 #include <linux/usb/musb.h>
17 #include <plat/onenand.h>
19 #include <plat/serial.h>
20 +#include <plat/cbus.h>
28 +#if defined(CONFIG_CBUS) || defined(CONFIG_CBUS_MODULE)
30 +static struct cbus_host_platform_data n8x0_cbus_data = {
36 +static struct platform_device n8x0_cbus_device = {
40 + .platform_data = &n8x0_cbus_data,
44 +static struct resource retu_resource[] = {
46 + .start = -EINVAL, /* set later */
47 + .flags = IORESOURCE_IRQ,
51 +static struct cbus_retu_platform_data n8x0_retu_data = {
52 + .irq_base = CBUS_RETU_IRQ_BASE,
53 + .irq_end = CBUS_RETU_IRQ_END,
54 + .devid = CBUS_RETU_DEVICE_ID,
57 +static struct platform_device retu_device = {
60 + .resource = retu_resource,
61 + .num_resources = ARRAY_SIZE(retu_resource),
63 + .platform_data = &n8x0_retu_data,
67 +static struct resource tahvo_resource[] = {
69 + .start = -EINVAL, /* set later */
70 + .flags = IORESOURCE_IRQ,
74 +static struct platform_device tahvo_device = {
77 + .resource = tahvo_resource,
78 + .num_resources = ARRAY_SIZE(tahvo_resource),
81 +static struct platform_device tahvo_usb_device = {
82 + .name = "tahvo-usb",
86 +static void __init n8x0_cbus_init(void)
90 + platform_device_register(&n8x0_cbus_device);
92 + ret = gpio_request(108, "RETU irq");
94 + pr_err("retu: Unable to reserve IRQ GPIO\n");
98 + ret = gpio_direction_input(108);
100 + pr_err("retu: Unable to change gpio direction\n");
105 + set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING);
106 + retu_resource[0].start = gpio_to_irq(108);
107 + platform_device_register(&retu_device);
109 + ret = gpio_request(111, "TAHVO irq");
111 + pr_err("tahvo: Unable to reserve IRQ GPIO\n");
116 + /* Set the pin as input */
117 + ret = gpio_direction_input(111);
119 + pr_err("tahvo: Unable to change direction\n");
125 + tahvo_resource[0].start = gpio_to_irq(111);
126 + platform_device_register(&tahvo_device);
127 + platform_device_register(&tahvo_usb_device);
131 +static inline void __init n8x0_cbus_init(void)
136 #if defined(CONFIG_MENELAUS) && \
137 (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
139 @@ -628,11 +739,10 @@
140 omap242x_map_common_io();
143 -static void __init n8x0_init_irq(void)
144 +static void __init n8x0_init_early(void)
146 omap2_init_common_infrastructure();
147 omap2_init_common_devices(NULL, NULL);
151 #ifdef CONFIG_OMAP_MUX
153 static void __init n8x0_init_machine(void)
155 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
158 /* FIXME: add n810 spi devices */
159 spi_register_board_info(n800_spi_board_info,
160 ARRAY_SIZE(n800_spi_board_info));
161 @@ -703,27 +815,30 @@
163 MACHINE_START(NOKIA_N800, "Nokia N800")
164 .boot_params = 0x80000100,
165 - .map_io = n8x0_map_io,
166 .reserve = omap_reserve,
167 - .init_irq = n8x0_init_irq,
168 + .map_io = n8x0_map_io,
169 + .init_early = n8x0_init_early,
170 + .init_irq = omap_init_irq,
171 .init_machine = n8x0_init_machine,
172 .timer = &omap_timer,
175 MACHINE_START(NOKIA_N810, "Nokia N810")
176 .boot_params = 0x80000100,
177 - .map_io = n8x0_map_io,
178 .reserve = omap_reserve,
179 - .init_irq = n8x0_init_irq,
180 + .map_io = n8x0_map_io,
181 + .init_early = n8x0_init_early,
182 + .init_irq = omap_init_irq,
183 .init_machine = n8x0_init_machine,
184 .timer = &omap_timer,
187 MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
188 .boot_params = 0x80000100,
189 - .map_io = n8x0_map_io,
190 .reserve = omap_reserve,
191 - .init_irq = n8x0_init_irq,
192 + .map_io = n8x0_map_io,
193 + .init_early = n8x0_init_early,
194 + .init_irq = omap_init_irq,
195 .init_machine = n8x0_init_machine,
196 .timer = &omap_timer,