X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=target%2Flinux%2Far71xx%2Ffiles%2Farch%2Fmips%2Fath79%2Fmach-tl-wr2543n.c;h=8f6db5eda179bd29c645a537c667cb2bf12b1e8a;hb=647f3fb9e22e63a02532add49a5c5427ee2d916b;hp=bb00b72e7de62b39337c7ff9313854c225c46527;hpb=d9077e15ae00813535ac3f226c7f74f3422df8c2;p=openwrt.git diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr2543n.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr2543n.c index bb00b72e7d..8f6db5eda1 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr2543n.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr2543n.c @@ -24,6 +24,10 @@ #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,14 @@ static struct gpio_led tl_wr2543n_leds_gpio[] __initdata = { } }; +static struct gpio_led tl_wr2543n_wmac_leds_gpio[] = { + { + .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", @@ -69,6 +80,7 @@ static struct gpio_keys_button tl_wr2543n_gpio_keys[] __initdata = { .code = KEY_WPS_BUTTON, .debounce_interval = TL_WR2543N_KEYS_DEBOUNCE_INTERVAL, .gpio = TL_WR2543N_GPIO_BTN_WPS, + .active_low = 1, } }; @@ -112,6 +124,20 @@ static void __init tl_wr2543n_setup(void) ARRAY_SIZE(tl_wr2543n_gpio_keys), tl_wr2543n_gpio_keys); ath79_register_usb(); + + /* + * The ath9k driver uses this pin for its default led device, which is + * named ath9k-phy0, and reflects activity on either the 2 GHz or 5 GHz + * bands. This pin is connected to the WR2543's 2GHz WLAN LED. + */ + ap9x_pci_setup_wmac_led_pin(0, TL_WR2543N_GPIO_WMAC_LED_WLAN2G); + + /* + * We also have the driver set up an led device for the WR2543's + * separate 5 GHz WLAN LED in case the user wants it. + */ + 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);