1 --- a/arch/arm/mach-omap2/board-n8x0.c
2 +++ b/arch/arm/mach-omap2/board-n8x0.c
4 #include <linux/delay.h>
5 #include <linux/gpio.h>
6 #include <linux/init.h>
7 +#include <linux/irq.h>
9 #include <linux/stddef.h>
10 +#include <linux/platform_device.h>
11 #include <linux/i2c.h>
12 #include <linux/spi/spi.h>
13 #include <linux/usb/musb.h>
15 #include <plat/onenand.h>
17 #include <plat/serial.h>
18 +#include <plat/cbus.h>
22 @@ -194,6 +197,114 @@ static struct omap_onenand_platform_data
26 +#if defined(CONFIG_CBUS) || defined(CONFIG_CBUS_MODULE)
28 +static struct cbus_host_platform_data n8x0_cbus_data = {
34 +static struct platform_device n8x0_cbus_device = {
38 + .platform_data = &n8x0_cbus_data,
42 +static struct resource retu_resource[] = {
44 + .start = -EINVAL, /* set later */
45 + .flags = IORESOURCE_IRQ,
49 +static struct cbus_retu_platform_data n8x0_retu_data = {
50 + .irq_base = CBUS_RETU_IRQ_BASE,
51 + .irq_end = CBUS_RETU_IRQ_END,
52 + .devid = CBUS_RETU_DEVICE_ID,
55 +static struct platform_device retu_device = {
58 + .resource = retu_resource,
59 + .num_resources = ARRAY_SIZE(retu_resource),
61 + .platform_data = &n8x0_retu_data,
65 +static struct resource tahvo_resource[] = {
67 + .start = -EINVAL, /* set later */
68 + .flags = IORESOURCE_IRQ,
72 +static struct platform_device tahvo_device = {
75 + .resource = tahvo_resource,
76 + .num_resources = ARRAY_SIZE(tahvo_resource),
79 +static struct platform_device tahvo_usb_device = {
80 + .name = "tahvo-usb",
84 +static void __init n8x0_cbus_init(void)
88 + platform_device_register(&n8x0_cbus_device);
90 + ret = gpio_request(108, "RETU irq");
92 + pr_err("retu: Unable to reserve IRQ GPIO\n");
96 + ret = gpio_direction_input(108);
98 + pr_err("retu: Unable to change gpio direction\n");
103 + set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING);
104 + retu_resource[0].start = gpio_to_irq(108);
105 + platform_device_register(&retu_device);
107 + ret = gpio_request(111, "TAHVO irq");
109 + pr_err("tahvo: Unable to reserve IRQ GPIO\n");
114 + /* Set the pin as input */
115 + ret = gpio_direction_input(111);
117 + pr_err("tahvo: Unable to change direction\n");
123 + tahvo_resource[0].start = gpio_to_irq(111);
124 + platform_device_register(&tahvo_device);
125 + platform_device_register(&tahvo_usb_device);
129 +static inline void __init n8x0_cbus_init(void)
134 #if defined(CONFIG_MENELAUS) && \
135 (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
137 @@ -628,11 +739,10 @@ static void __init n8x0_map_io(void)
138 omap242x_map_common_io();
141 -static void __init n8x0_init_irq(void)
142 +static void __init n8x0_init_early(void)
144 omap2_init_common_infrastructure();
145 omap2_init_common_devices(NULL, NULL);
149 #ifdef CONFIG_OMAP_MUX
150 @@ -686,6 +796,8 @@ static inline void board_serial_init(voi
151 static void __init n8x0_init_machine(void)
153 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
156 /* FIXME: add n810 spi devices */
157 spi_register_board_info(n800_spi_board_info,
158 ARRAY_SIZE(n800_spi_board_info));
159 @@ -703,27 +815,30 @@ static void __init n8x0_init_machine(voi
161 MACHINE_START(NOKIA_N800, "Nokia N800")
162 .boot_params = 0x80000100,
163 - .map_io = n8x0_map_io,
164 .reserve = omap_reserve,
165 - .init_irq = n8x0_init_irq,
166 + .map_io = n8x0_map_io,
167 + .init_early = n8x0_init_early,
168 + .init_irq = omap_init_irq,
169 .init_machine = n8x0_init_machine,
170 .timer = &omap_timer,
173 MACHINE_START(NOKIA_N810, "Nokia N810")
174 .boot_params = 0x80000100,
175 - .map_io = n8x0_map_io,
176 .reserve = omap_reserve,
177 - .init_irq = n8x0_init_irq,
178 + .map_io = n8x0_map_io,
179 + .init_early = n8x0_init_early,
180 + .init_irq = omap_init_irq,
181 .init_machine = n8x0_init_machine,
182 .timer = &omap_timer,
185 MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
186 .boot_params = 0x80000100,
187 - .map_io = n8x0_map_io,
188 .reserve = omap_reserve,
189 - .init_irq = n8x0_init_irq,
190 + .map_io = n8x0_map_io,
191 + .init_early = n8x0_init_early,
192 + .init_irq = omap_init_irq,
193 .init_machine = n8x0_init_machine,
194 .timer = &omap_timer,