lantiq: rename leds
[openwrt/svn-archive/archive.git] / target / linux / lantiq / files-3.1 / arch / mips / lantiq / xway / mach-arv45xx.c
index ce3ab388be4a86e149c7430b4e6198e25171ba35..67685465a0f16e7f4e682674f907a43e186fdc82 100644 (file)
 #include <lantiq_soc.h>
 #include <lantiq_platform.h>
 #include <dev-gpio-leds.h>
+#include <dev-gpio-buttons.h>
 
 #include "../machtypes.h"
+#include "../dev-wifi-rt2x00.h"
 #include "devices.h"
 #include "dev-dwc_otg.h"
 
@@ -165,7 +167,7 @@ arv4518pw_gpio_leds[] __initdata = {
        { .name = "soc:green:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:green:wifi", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:yellow:wps", .gpio = 7, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:red:fail", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:green:usb", .gpio = 19, .active_low = 1, .default_trigger = "default-on" },
@@ -177,7 +179,7 @@ arv4518pw_gpio_leds[] __initdata = {
 
 static struct gpio_button
 arv4518pw_gpio_buttons[] __initdata = {
-       { .desc = "wlan", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 28, .active_low = 1, },
+       { .desc = "wifi", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 28, .active_low = 1, },
        { .desc = "wps", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 29, .active_low = 1, },
        { .desc = "reset", .type = EV_KEY, .code = BTN_2, .threshold = 3, .gpio = 30, .active_low = 1, },
 };
@@ -196,7 +198,7 @@ arv4520pw_gpio_leds[] __initdata = {
        { .name = "soc:blue:fxo", .gpio = 103, .active_low = 1, },
        { .name = "soc:blue:voice", .gpio = 104, .active_low = 1, },
        { .name = "soc:blue:usb", .gpio = 105, .active_low = 1, },
-       { .name = "soc:blue:wlan", .gpio = 106, .active_low = 1, },
+       { .name = "soc:blue:wifi", .gpio = 106, .active_low = 1, },
 };
 
 static struct gpio_led
@@ -213,17 +215,17 @@ arv452cpw_gpio_leds[] __initdata = {
        { .name = "soc:blue:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:blue:voice", .gpio = 104, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:blue:usb", .gpio = 105, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:blue:wlan", .gpio = 106, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:blue:wifi", .gpio = 106, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:blue:internet", .gpio = 108, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:red:internet", .gpio = 109, .active_low = 1, .default_trigger = "default-on" },
 };
 
 static struct gpio_led
 arv4525pw_gpio_leds[] __initdata = {
-       { .name = "soc:green:festnetz", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:green:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:green:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:green:wlan", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:green:fxs1", .gpio = 4, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:green:fxs2", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:red:dsl", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:green:wifi", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:green:online", .gpio = 9, .active_low = 1, .default_trigger = "default-on" },
 };
 
@@ -236,10 +238,10 @@ arv752dpw22_gpio_leds[] __initdata = {
        { .name = "soc:red:fxo", .gpio = 103, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:red:voice", .gpio = 104, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:green:usb", .gpio = 105, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:green:wlan", .gpio = 106, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:green:wlan1", .gpio = 107, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:blue:wlan", .gpio = 108, .active_low = 1, .default_trigger = "default-on" },
-       { .name = "soc:blue:wlan1", .gpio = 109, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:green:wifi", .gpio = 106, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:green:wifi1", .gpio = 107, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:blue:wifi", .gpio = 108, .active_low = 1, .default_trigger = "default-on" },
+       { .name = "soc:blue:wifi1", .gpio = 109, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:green:eth1", .gpio = 111, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:green:eth2", .gpio = 112, .active_low = 1, .default_trigger = "default-on" },
        { .name = "soc:green:eth3", .gpio = 113, .active_low = 1, .default_trigger = "default-on" },
@@ -258,7 +260,7 @@ arv7518pw_gpio_leds[] __initdata = {
        { .name = "soc:green:power", .gpio = 2, .active_low = 1, },
        { .name = "soc:green:adsl", .gpio = 4, .active_low = 1, },
        { .name = "soc:green:internet", .gpio = 5, .active_low = 1, },
-       { .name = "soc:green:wlan", .gpio = 6, .active_low = 1, },
+       { .name = "soc:green:wifi", .gpio = 6, .active_low = 1, },
        { .name = "soc:red:internet", .gpio = 8, .active_low = 1, },
        { .name = "soc:green:usb", .gpio = 19, .active_low = 1, },
 };
@@ -266,7 +268,7 @@ arv7518pw_gpio_leds[] __initdata = {
 static struct gpio_button
 arv7518pw_gpio_buttons[] __initdata = {
        { .desc = "reset", .type = EV_KEY, .code = BTN_0, .threshold = 3, .gpio = 23, .active_low = 1, },
-       { .desc = "wlan", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 25, .active_low = 1, },
+       { .desc = "wifi", .type = EV_KEY, .code = BTN_1, .threshold = 3, .gpio = 25, .active_low = 1, },
 };
 
 static void
@@ -459,11 +461,11 @@ MIPS_MACHINE(LANTIQ_MACH_ARV452CPW,
                        "ARV452CPW - Arcor A801",
                        arv452Cpw_init);
 
-#define ARV4525PW_MADWIFI_ADDR         0xb07f0400
 
 static void __init
 arv4525pw_init(void)
 {
+#define ARV4525PW_MADWIFI_ADDR         0xb07f0400
        ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds);
        ltq_register_nor(&arv45xx_flash_data);
        ltq_pci_data.clock = PCI_CLOCK_INT;
@@ -478,15 +480,33 @@ MIPS_MACHINE(LANTIQ_MACH_ARV4525PW,
                        "ARV4525PW - Speedport W502V",
                        arv4525pw_init);
 
+static struct gpio_keys_button
+arv7525pw_gpio_keys[] __initdata = {
+       {
+               .desc           = "restart",
+               .type           = EV_KEY,
+               .code           = BTN_0,
+               .debounce_interval = LTQ_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = 29,
+               .active_low     = 1,
+       },
+};
+
 static void __init
 arv7525pw_init(void)
 {
        ltq_add_device_gpio_leds(-1, ARRAY_SIZE(arv4525pw_gpio_leds), arv4525pw_gpio_leds);
        ltq_register_nor(&arv7525_flash_data);
+       ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
+                               ARRAY_SIZE(arv7525pw_gpio_keys), arv7525pw_gpio_keys);
        ltq_pci_data.clock = PCI_CLOCK_INT;
+       ltq_pci_data.gpio = PCI_GNT1 | PCI_EXIN1;
+       ltq_pci_data.irq[14] = (INT_NUM_IM3_IRL0 + 31);
        ltq_register_pci(&ltq_pci_data);
        ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
        arv45xx_register_ethernet();
+       ltq_register_rt2x00("RT2860.eeprom");
+       ltq_register_tapi();
 }
 
 MIPS_MACHINE(LANTIQ_MACH_ARV7525PW,