1 Index: linux-3.1/arch/arm/mach-omap2/board-n8x0.c
2 ===================================================================
3 --- linux-3.1.orig/arch/arm/mach-omap2/board-n8x0.c 2011-10-30 21:04:56.008818251 +0100
4 +++ linux-3.1/arch/arm/mach-omap2/board-n8x0.c 2011-10-30 21:14:31.600257909 +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/platform_data/cbus.h>
14 #include <linux/i2c.h>
15 #include <linux/spi/spi.h>
16 #include <linux/usb/musb.h>
17 @@ -193,6 +196,110 @@ static struct omap_onenand_platform_data
21 +#if defined(CONFIG_CBUS) || defined(CONFIG_CBUS_MODULE)
23 +static struct cbus_host_platform_data n8x0_cbus_data = {
29 +static struct platform_device n8x0_cbus_device = {
33 + .platform_data = &n8x0_cbus_data,
37 +static struct resource retu_resource[] = {
39 + .start = -EINVAL, /* set later */
40 + .flags = IORESOURCE_IRQ,
44 +static struct cbus_retu_platform_data n8x0_retu_data = {
45 + .devid = CBUS_RETU_DEVICE_ID,
48 +static struct platform_device retu_device = {
51 + .resource = retu_resource,
52 + .num_resources = ARRAY_SIZE(retu_resource),
54 + .platform_data = &n8x0_retu_data,
55 + .parent = &n8x0_cbus_device.dev,
59 +static struct resource tahvo_resource[] = {
61 + .start = -EINVAL, /* set later */
62 + .flags = IORESOURCE_IRQ,
66 +static struct platform_device tahvo_device = {
69 + .resource = tahvo_resource,
70 + .num_resources = ARRAY_SIZE(tahvo_resource),
72 + .parent = &n8x0_cbus_device.dev,
76 +static void __init n8x0_cbus_init(void)
80 + platform_device_register(&n8x0_cbus_device);
82 + ret = gpio_request(108, "RETU irq");
84 + pr_err("retu: Unable to reserve IRQ GPIO\n");
88 + ret = gpio_direction_input(108);
90 + pr_err("retu: Unable to change gpio direction\n");
95 + irq_set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING);
96 + retu_resource[0].start = gpio_to_irq(108);
97 + platform_device_register(&retu_device);
99 + ret = gpio_request(111, "TAHVO irq");
101 + pr_err("tahvo: Unable to reserve IRQ GPIO\n");
106 + /* Set the pin as input */
107 + ret = gpio_direction_input(111);
109 + pr_err("tahvo: Unable to change direction\n");
115 + tahvo_resource[0].start = gpio_to_irq(111);
116 + platform_device_register(&tahvo_device);
120 +static inline void __init n8x0_cbus_init(void)
125 #if defined(CONFIG_MENELAUS) && \
126 (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
128 @@ -679,6 +786,8 @@ static inline void board_serial_init(voi
129 static void __init n8x0_init_machine(void)
131 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
134 /* FIXME: add n810 spi devices */
135 spi_register_board_info(n800_spi_board_info,
136 ARRAY_SIZE(n800_spi_board_info));
137 Index: linux-3.1/include/linux/platform_data/cbus.h
138 ===================================================================
139 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
140 +++ linux-3.1/include/linux/platform_data/cbus.h 2011-10-30 21:05:07.540709042 +0100
143 + * cbus.h - CBUS platform_data definition
145 + * Copyright (C) 2004 - 2009 Nokia Corporation
147 + * Written by Felipe Balbi <felipe.balbi@nokia.com>
149 + * This file is subject to the terms and conditions of the GNU General
150 + * Public License. See the file "COPYING" in the main directory of this
151 + * archive for more details.
153 + * This program is distributed in the hope that it will be useful,
154 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
155 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
156 + * GNU General Public License for more details.
158 + * You should have received a copy of the GNU General Public License
159 + * along with this program; if not, write to the Free Software
160 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
163 +#ifndef __INCLUDE_LINUX_CBUS_H
164 +#define __INCLUDE_LINUX_CBUS_H
166 +#define CBUS_RETU_DEVICE_ID 0x01
167 +#define CBUS_TAHVO_DEVICE_ID 0x02
169 +struct cbus_host_platform_data {
175 +struct cbus_retu_platform_data {
179 +#endif /* __INCLUDE_LINUX_CBUS_H */