[ar71xx] simplify leds-gpio device registration
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-rb-4xx.c
index 7504c349a6a9ec074b836bc8baf0ed00a93d7647..f2b5e05722f2f6f86804b6fa877400ee43cbfa4f 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/mmc_spi.h>
-#include <linux/leds.h>
 
 #include <asm/mips_machine.h>
 #include <asm/mach-ar71xx/ar71xx.h>
@@ -24,7 +23,7 @@
 
 #define RB4XX_GPIO_USER_LED    4
 
-static struct gpio_led rb4xx_leds_gpio[] = {
+static struct gpio_led rb4xx_leds_gpio[] __initdata = {
        {
                .name           = "rb4xx:yellow:user",
                .gpio           = RB4XX_GPIO_USER_LED,
@@ -32,19 +31,6 @@ static struct gpio_led rb4xx_leds_gpio[] = {
        },
 };
 
-static struct gpio_led_platform_data rb4xx_leds_gpio_data = {
-       .leds           = rb4xx_leds_gpio,
-       .num_leds       = ARRAY_SIZE(rb4xx_leds_gpio),
-};
-
-static struct platform_device rb4xx_leds_gpio_device = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev = {
-               .platform_data = &rb4xx_leds_gpio_data,
-       }
-};
-
 static struct platform_device rb4xx_nand_device = {
        .name   = "rb4xx-nand",
        .id     = -1,
@@ -153,9 +139,12 @@ static void __init rb411_setup(void)
 {
        rb4xx_add_device_spi();
 
+       ar71xx_add_device_mdio(0xfffffffe);
        ar71xx_add_device_eth(0, PHY_INTERFACE_MODE_MII, 0x00000001);
 
-       platform_device_register(&rb4xx_leds_gpio_device);
+       ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
+                                       rb4xx_leds_gpio);
+
        platform_device_register(&rb4xx_nand_device);
 
        ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
@@ -167,10 +156,13 @@ static void __init rb433_setup(void)
 {
        rb433_add_device_spi();
 
-       ar71xx_add_device_eth(0, PHY_INTERFACE_MODE_MII, 0x00000001);
-       ar71xx_add_device_eth(1, PHY_INTERFACE_MODE_RMII, 0xffffffff);
+       ar71xx_add_device_mdio(0xffffffec);
+       ar71xx_add_device_eth(1, PHY_INTERFACE_MODE_RMII, 0x00000010);
+       ar71xx_add_device_eth(0, PHY_INTERFACE_MODE_MII, 0x00000003);
+
+       ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
+                                       rb4xx_leds_gpio);
 
-       platform_device_register(&rb4xx_leds_gpio_device);
        platform_device_register(&rb4xx_nand_device);
 
        ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
@@ -182,10 +174,13 @@ static void __init rb450_setup(void)
 {
        rb4xx_add_device_spi();
 
-       ar71xx_add_device_eth(0, PHY_INTERFACE_MODE_MII, 0x00000001);
-       ar71xx_add_device_eth(1, PHY_INTERFACE_MODE_RMII, 0xffffffff);
+       ar71xx_add_device_mdio(0xffffffe0);
+       ar71xx_add_device_eth(1, PHY_INTERFACE_MODE_RMII, 0x00000010);
+       ar71xx_add_device_eth(0, PHY_INTERFACE_MODE_MII, 0x0000000f);
+
+       ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
+                                       rb4xx_leds_gpio);
 
-       platform_device_register(&rb4xx_leds_gpio_device);
        platform_device_register(&rb4xx_nand_device);
 }