summaryrefslogtreecommitdiffstats
path: root/target/linux/au1000/files/arch
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-10-10 14:03:16 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-10-10 14:03:16 +0000
commit8dba7c58613c7f48c08a3ee0109b270dd23e5c78 (patch)
tree566355574ba0ee857b9b3aad7dc3c26b8b753b34 /target/linux/au1000/files/arch
parentff18604cfb9914b779afbe4defe8deada6d8ecd3 (diff)
Upgrade au1000 to 2.6.23
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9243 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/au1000/files/arch')
-rw-r--r--target/linux/au1000/files/arch/mips/au1000/mtx-1/platform.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/target/linux/au1000/files/arch/mips/au1000/mtx-1/platform.c b/target/linux/au1000/files/arch/mips/au1000/mtx-1/platform.c
index e5116f08e..529595fcd 100644
--- a/target/linux/au1000/files/arch/mips/au1000/mtx-1/platform.c
+++ b/target/linux/au1000/files/arch/mips/au1000/mtx-1/platform.c
@@ -26,13 +26,31 @@
#include <asm/gpio.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
+static struct resource mtx1_wdt_res[] = {
+ [0] = {
+ .start = 15,
+ .end = 15,
+ .name = "mtx1-wdt-gpio",
+ .flags = IORESOURCE_IRQ,
+ }
+};
+
+static struct platform_device mtx1_wdt = {
+ .name = "mtx1-wdt",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(mtx1_wdt_res),
+ .resource = mtx1_wdt_res,
+};
+
static struct gpio_led default_leds[] = {
- { .name = "mtx1:green", .gpio = 211, .active_low = 1, },
- { .name = "mtx1:red", gpio = 212, .active_low = 1, },
-}
+ { .name = "mtx1:green", .gpio = 211, },
+ { .name = "mtx1:red", .gpio = 212, },
+};
-static struct gpio_led_platform_data mtx1_led_data;
+static struct gpio_led_platform_data mtx1_led_data = {
+ .num_leds = ARRAY_SIZE(default_leds),
+ .leds = default_leds,
+};
static struct platform_device mtx1_gpio_leds = {
.name = "leds-gpio",
@@ -41,18 +59,16 @@ static struct platform_device mtx1_gpio_leds = {
.platform_data = &mtx1_led_data,
}
};
-#endif
+
+static struct platform_device *mtx1_devs[] = {
+ &mtx1_gpio_leds,
+ &mtx1_wdt
+};
static int __init mtx1_register_devices(void)
{
- int res;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
- mtx1_led_data.num_leds = ARRAY_SIZE(default_leds);
- mtx1_led_data.leds = default_leds;
- res = platform_device_register(&mtx1_gpio_leds);
-#endif
- return res;
+ return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs));
}
-arch_initall(mtx1_register_devices);
+arch_initcall(mtx1_register_devices);