X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Fatheros%2Ffiles%2Farch%2Fmips%2Fatheros%2Far5315%2Fboard.c;h=6d46c85a1ec6c5154ce25c30137f4d10d343ce5f;hb=7fc1813a4d2288bb3923f4b71e06a0ec4e055304;hp=57d17f526ae02f5bfc0cf8e59648396b60630fab;hpb=5e1f0b5bb07f841701341a9eaad5d14d2ce791e8;p=openwrt.git diff --git a/target/linux/atheros/files/arch/mips/atheros/ar5315/board.c b/target/linux/atheros/files/arch/mips/atheros/ar5315/board.c index 57d17f526a..6d46c85a1e 100644 --- a/target/linux/atheros/files/arch/mips/atheros/ar5315/board.c +++ b/target/linux/atheros/files/arch/mips/atheros/ar5315/board.c @@ -27,6 +27,7 @@ #include #include #include +#include static int is_5315 = 0; @@ -90,7 +91,27 @@ static struct platform_device ar5315_spiflash = { .num_resources = ARRAY_SIZE(ar5315_spiflash_res) }; -static __initdata struct platform_device *ar5315_devs[4]; +#ifdef CONFIG_LEDS_GPIO +static struct gpio_led ar5315_leds[] = { + { .name = "wlan", .gpio = 0, .active_low = 1, }, +}; + +static const struct gpio_led_platform_data ar5315_led_data = { + .num_leds = ARRAY_SIZE(ar5315_leds), + .leds = (void *) ar5315_leds, +}; + +static struct platform_device ar5315_gpio_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { + .platform_data = (void *) &ar5315_led_data, + } +}; +#endif + + +static __initdata struct platform_device *ar5315_devs[5]; @@ -218,11 +239,13 @@ int __init ar5315_init_devices(void) ar5315_eth_data.board_config = board_config; ar5315_eth_data.macaddr = bcfg->enet0Mac; ar5315_wmac.dev.platform_data = config; - + + ar5315_leds[0].gpio = bcfg->sysLedGpio; + ar5315_devs[dev++] = &ar5315_eth; ar5315_devs[dev++] = &ar5315_wmac; ar5315_devs[dev++] = &ar5315_spiflash; - + ar5315_devs[dev++] = &ar5315_gpio_leds; return platform_add_devices(ar5315_devs, dev); }