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/platform_data/cbus.h>
12 #include <linux/i2c.h>
13 #include <linux/spi/spi.h>
14 #include <linux/usb/musb.h>
15 @@ -193,6 +196,110 @@ static struct omap_onenand_platform_data
19 +#if defined(CONFIG_CBUS) || defined(CONFIG_CBUS_MODULE)
21 +static struct cbus_host_platform_data n8x0_cbus_data = {
27 +static struct platform_device n8x0_cbus_device = {
31 + .platform_data = &n8x0_cbus_data,
35 +static struct resource retu_resource[] = {
37 + .start = -EINVAL, /* set later */
38 + .flags = IORESOURCE_IRQ,
42 +static struct cbus_retu_platform_data n8x0_retu_data = {
43 + .devid = CBUS_RETU_DEVICE_ID,
46 +static struct platform_device retu_device = {
49 + .resource = retu_resource,
50 + .num_resources = ARRAY_SIZE(retu_resource),
52 + .platform_data = &n8x0_retu_data,
53 + .parent = &n8x0_cbus_device.dev,
57 +static struct resource tahvo_resource[] = {
59 + .start = -EINVAL, /* set later */
60 + .flags = IORESOURCE_IRQ,
64 +static struct platform_device tahvo_device = {
67 + .resource = tahvo_resource,
68 + .num_resources = ARRAY_SIZE(tahvo_resource),
70 + .parent = &n8x0_cbus_device.dev,
74 +static void __init n8x0_cbus_init(void)
78 + platform_device_register(&n8x0_cbus_device);
80 + ret = gpio_request(108, "RETU irq");
82 + pr_err("retu: Unable to reserve IRQ GPIO\n");
86 + ret = gpio_direction_input(108);
88 + pr_err("retu: Unable to change gpio direction\n");
93 + irq_set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING);
94 + retu_resource[0].start = gpio_to_irq(108);
95 + platform_device_register(&retu_device);
97 + ret = gpio_request(111, "TAHVO irq");
99 + pr_err("tahvo: Unable to reserve IRQ GPIO\n");
104 + /* Set the pin as input */
105 + ret = gpio_direction_input(111);
107 + pr_err("tahvo: Unable to change direction\n");
113 + tahvo_resource[0].start = gpio_to_irq(111);
114 + platform_device_register(&tahvo_device);
118 +static inline void __init n8x0_cbus_init(void)
123 #if defined(CONFIG_MENELAUS) && \
124 (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
126 @@ -679,6 +786,8 @@ static inline void board_serial_init(voi
127 static void __init n8x0_init_machine(void)
129 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
132 /* FIXME: add n810 spi devices */
133 spi_register_board_info(n800_spi_board_info,
134 ARRAY_SIZE(n800_spi_board_info));
136 +++ b/include/linux/platform_data/cbus.h
139 + * cbus.h - CBUS platform_data definition
141 + * Copyright (C) 2004 - 2009 Nokia Corporation
143 + * Written by Felipe Balbi <felipe.balbi@nokia.com>
145 + * This file is subject to the terms and conditions of the GNU General
146 + * Public License. See the file "COPYING" in the main directory of this
147 + * archive for more details.
149 + * This program is distributed in the hope that it will be useful,
150 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
151 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
152 + * GNU General Public License for more details.
154 + * You should have received a copy of the GNU General Public License
155 + * along with this program; if not, write to the Free Software
156 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
159 +#ifndef __INCLUDE_LINUX_CBUS_H
160 +#define __INCLUDE_LINUX_CBUS_H
162 +#define CBUS_RETU_DEVICE_ID 0x01
163 +#define CBUS_TAHVO_DEVICE_ID 0x02
165 +struct cbus_host_platform_data {
171 +struct cbus_retu_platform_data {
175 +#endif /* __INCLUDE_LINUX_CBUS_H */