diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2012-12-19 16:41:01 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2013-02-01 17:59:34 -0500 |
commit | e496efd950dbf7c22141f334e887344ab94f8df0 (patch) | |
tree | a41688e63d3ccdf59e95e4a981df03c23e2a4f35 /arch/arm/mach-omap1 | |
parent | 72718e8ce011b2dbf8e6c09a66eb68499a2986e8 (diff) |
ARM: OMAP1: nokia770: enable CBUS/Retu
Add needed platform data so that it's possible to use Retu and e.g. feed
Retu watchdog.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r-- | arch/arm/mach-omap1/board-nokia770.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 24d2f2df11a0..ecd3f2a61bd4 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/irq.h> | ||
10 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
11 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
@@ -23,6 +24,8 @@ | |||
23 | 24 | ||
24 | #include <linux/platform_data/keypad-omap.h> | 25 | #include <linux/platform_data/keypad-omap.h> |
25 | #include <linux/platform_data/lcd-mipid.h> | 26 | #include <linux/platform_data/lcd-mipid.h> |
27 | #include <linux/platform_data/gpio-omap.h> | ||
28 | #include <linux/platform_data/i2c-cbus-gpio.h> | ||
26 | 29 | ||
27 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
28 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
@@ -212,6 +215,45 @@ static inline void nokia770_mmc_init(void) | |||
212 | } | 215 | } |
213 | #endif | 216 | #endif |
214 | 217 | ||
218 | #if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE) | ||
219 | static struct i2c_cbus_platform_data nokia770_cbus_data = { | ||
220 | .clk_gpio = OMAP_MPUIO(9), | ||
221 | .dat_gpio = OMAP_MPUIO(10), | ||
222 | .sel_gpio = OMAP_MPUIO(11), | ||
223 | }; | ||
224 | |||
225 | static struct platform_device nokia770_cbus_device = { | ||
226 | .name = "i2c-cbus-gpio", | ||
227 | .id = 2, | ||
228 | .dev = { | ||
229 | .platform_data = &nokia770_cbus_data, | ||
230 | }, | ||
231 | }; | ||
232 | |||
233 | static struct i2c_board_info nokia770_i2c_board_info_2[] __initdata = { | ||
234 | { | ||
235 | I2C_BOARD_INFO("retu-mfd", 0x01), | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | static void __init nokia770_cbus_init(void) | ||
240 | { | ||
241 | const int retu_irq_gpio = 62; | ||
242 | |||
243 | if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ")) | ||
244 | return; | ||
245 | irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING); | ||
246 | nokia770_i2c_board_info_2[0].irq = gpio_to_irq(retu_irq_gpio); | ||
247 | i2c_register_board_info(2, nokia770_i2c_board_info_2, | ||
248 | ARRAY_SIZE(nokia770_i2c_board_info_2)); | ||
249 | platform_device_register(&nokia770_cbus_device); | ||
250 | } | ||
251 | #else /* CONFIG_I2C_CBUS_GPIO */ | ||
252 | static void __init nokia770_cbus_init(void) | ||
253 | { | ||
254 | } | ||
255 | #endif /* CONFIG_I2C_CBUS_GPIO */ | ||
256 | |||
215 | static void __init omap_nokia770_init(void) | 257 | static void __init omap_nokia770_init(void) |
216 | { | 258 | { |
217 | /* On Nokia 770, the SleepX signal is masked with an | 259 | /* On Nokia 770, the SleepX signal is masked with an |
@@ -233,6 +275,7 @@ static void __init omap_nokia770_init(void) | |||
233 | mipid_dev_init(); | 275 | mipid_dev_init(); |
234 | omap1_usb_init(&nokia770_usb_config); | 276 | omap1_usb_init(&nokia770_usb_config); |
235 | nokia770_mmc_init(); | 277 | nokia770_mmc_init(); |
278 | nokia770_cbus_init(); | ||
236 | } | 279 | } |
237 | 280 | ||
238 | MACHINE_START(NOKIA770, "Nokia 770") | 281 | MACHINE_START(NOKIA770, "Nokia 770") |