summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/files/arch/mips
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-09-04 13:39:11 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-09-04 13:39:11 +0000
commitda7312105d3b1e30efc8d9724079388f74f9122d (patch)
tree5a57f68e4346fa9ff427ed87076a1f9fd2dc755f /target/linux/ar71xx/files/arch/mips
parent09a0c731690911d8218254f59636d8b13883aca0 (diff)
downloadmtk-20170518-da7312105d3b1e30efc8d9724079388f74f9122d.zip
mtk-20170518-da7312105d3b1e30efc8d9724079388f74f9122d.tar.gz
mtk-20170518-da7312105d3b1e30efc8d9724079388f74f9122d.tar.bz2
register gpio-leds on the WP543 board
SVN-Revision: 12528
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
index b706240..0bf45ad 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
@@ -12,12 +12,19 @@
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
+#include <linux/leds.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include <asm/mach-ar71xx/pci.h>
#include <asm/mach-ar71xx/platform.h>
+#define WP543_GPIO_LED_1 3
+#define WP543_GPIO_LED_2 4
+#define WP543_GPIO_LED_WLAN 5
+#define WP543_GPIO_LED_CONN 6
+#define WP543_GPIO_LED_DIAG 7
+
static struct flash_platform_data wp543_flash_data = {
/* TODO: add partition map */
};
@@ -44,6 +51,43 @@ static struct ar71xx_pci_irq wp543_pci_irqs[] __initdata = {
}
};
+static struct gpio_led wp543_leds_gpio[] = {
+ {
+ .name = "wp543:green:led1",
+ .gpio = WP543_GPIO_LED_1,
+ .active_low = 1,
+ }, {
+ .name = "wp543:green:led2",
+ .gpio = WP543_GPIO_LED_2,
+ .active_low = 1,
+ }, {
+ .name = "wp543:green:wlan",
+ .gpio = WP543_GPIO_LED_WLAN,
+ .active_low = 1,
+ }, {
+ .name = "wp543:green:conn",
+ .gpio = WP543_GPIO_LED_CONN,
+ .active_low = 1,
+ }, {
+ .name = "wp543:green:diag",
+ .gpio = WP543_GPIO_LED_DIAG,
+ .active_low = 1,
+ }
+};
+
+static struct gpio_led_platform_data wp543_leds_gpio_data = {
+ .leds = wp543_leds_gpio,
+ .num_leds = ARRAY_SIZE(wp543_leds_gpio),
+};
+
+static struct platform_device wp543_leds_gpio_device = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &wp543_leds_gpio_data,
+ }
+};
+
static void __init wp543_setup(void)
{
ar71xx_add_device_spi(NULL, wp543_spi_info, ARRAY_SIZE(wp543_spi_info));
@@ -54,6 +98,8 @@ static void __init wp543_setup(void)
ar71xx_add_device_usb();
ar71xx_pci_init(ARRAY_SIZE(wp543_pci_irqs), wp543_pci_irqs);
+
+ platform_device_register(&wp543_leds_gpio_device);
}
MIPS_MACHINE(MACH_AR71XX_WP543, "Compex WP543", wp543_setup);