2 * linux/arch/arm/plat-omap/debug-devices.c
4 * Copyright (C) 2005 Nokia Corporation
5 * Modified from mach-omap2/board-h4.c
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
16 #include <asm/hardware.h>
19 #include <asm/arch/board.h>
20 #include <asm/arch/gpio.h>
23 /* Many OMAP development platforms reuse the same "debug board"; these
24 * platforms include H2, H3, H4, and Perseus2.
27 static struct resource smc91x_resources[] = {
29 .flags = IORESOURCE_MEM,
32 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
36 static struct platform_device smc91x_device = {
39 .num_resources = ARRAY_SIZE(smc91x_resources),
40 .resource = smc91x_resources,
43 static struct resource led_resources[] = {
45 .flags = IORESOURCE_MEM,
49 static struct platform_device led_device = {
50 .name = "omap_dbg_led",
52 .num_resources = ARRAY_SIZE(led_resources),
53 .resource = led_resources,
56 static struct platform_device *debug_devices[] __initdata = {
59 /* ps2 kbd + mouse ports */
61 /* 6 input dip switches */
65 int __init debug_card_init(u32 addr, unsigned gpio)
69 smc91x_resources[0].start = addr + 0x300;
70 smc91x_resources[0].end = addr + 0x30f;
72 smc91x_resources[1].start = OMAP_GPIO_IRQ(gpio);
73 smc91x_resources[1].end = OMAP_GPIO_IRQ(gpio);
75 status = omap_request_gpio(gpio);
77 printk(KERN_ERR "GPIO%d unavailable for smc91x IRQ\n", gpio);
80 omap_set_gpio_direction(gpio, 1);
82 led_resources[0].start = addr;
83 led_resources[0].end = addr + SZ_4K - 1;
85 return platform_add_devices(debug_devices, ARRAY_SIZE(debug_devices));