ar71xx: add definitions for RouterBOARD hardware option bits
[openwrt/openwrt.git] / target / linux / ar71xx / files / arch / mips / ath79 / mach-tl-wr2543n.c
index d4a66cd16b4c318a18bd77cdedf4c9f8cac870ef..141914aa2913cad66fcf10b9f5a23970a747bf17 100644 (file)
 #define TL_WR2543N_GPIO_LED_WPS        0
 #define TL_WR2543N_GPIO_LED_USB        8
 
+/* The WLAN LEDs use GPIOs on the discrete AR9380 wmac */
+#define TL_WR2543N_GPIO_WMAC_LED_WLAN2G 0
+#define TL_WR2543N_GPIO_WMAC_LED_WLAN5G 1
+
 #define TL_WR2543N_GPIO_BTN_RESET      11
 #define TL_WR2543N_GPIO_BTN_WPS        12
 
@@ -40,7 +44,6 @@ static const char *tl_wr2543n_part_probes[] = {
 
 static struct flash_platform_data tl_wr2543n_flash_data = {
        .part_probes    = tl_wr2543n_part_probes,
-       .max_read_len   = 64,
 };
 
 static struct gpio_led tl_wr2543n_leds_gpio[] __initdata = {
@@ -55,6 +58,19 @@ static struct gpio_led tl_wr2543n_leds_gpio[] __initdata = {
        }
 };
 
+static struct gpio_led tl_wr2543n_wmac_leds_gpio[] = {
+       {
+               .name           = "tp-link:green:wlan2g",
+               .gpio           = TL_WR2543N_GPIO_WMAC_LED_WLAN2G,
+               .active_low     = 1,
+       },
+       {
+               .name           = "tp-link:green:wlan5g",
+               .gpio           = TL_WR2543N_GPIO_WMAC_LED_WLAN5G,
+               .active_low     = 1,
+       },
+};
+
 static struct gpio_keys_button tl_wr2543n_gpio_keys[] __initdata = {
        {
                .desc           = "reset",
@@ -113,6 +129,9 @@ static void __init tl_wr2543n_setup(void)
                                        ARRAY_SIZE(tl_wr2543n_gpio_keys),
                                        tl_wr2543n_gpio_keys);
        ath79_register_usb();
+
+       ap9x_pci_setup_wmac_leds(0, tl_wr2543n_wmac_leds_gpio,
+                                ARRAY_SIZE(tl_wr2543n_wmac_leds_gpio));
        ap91_pci_init(eeprom, mac);
 
        ath79_init_mac(ath79_eth0_data.mac_addr, mac, -1);