diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2014-02-23 08:11:53 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2014-02-23 08:11:53 +0000 |
commit | da2f3c1448c870cc29d5fd66dbe45beeb23a6d20 (patch) | |
tree | a1b0d37c6d1b38deccfed25888c9dff98f87a1e2 /target/linux | |
parent | 14d95026b2968d1ac7df2198995079ba2d0fb9af (diff) | |
download | upstream-da2f3c1448c870cc29d5fd66dbe45beeb23a6d20.tar.gz upstream-da2f3c1448c870cc29d5fd66dbe45beeb23a6d20.tar.bz2 upstream-da2f3c1448c870cc29d5fd66dbe45beeb23a6d20.zip |
ar71xx: rb91x: register GPIO LEDs
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 39704
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c index 0dc2e0fcc0..75382bef93 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c @@ -68,6 +68,8 @@ #define RB91X_SSR_BIT_PCIE_POWER 7 #define RB91X_GPIO_SSR_STROBE RB91X_LATCH_GPIO(0) +#define RB91X_GPIO_LED_POWER RB91X_LATCH_GPIO(1) +#define RB91X_GPIO_LED_USER RB91X_LATCH_GPIO(2) #define RB91X_GPIO_NAND_READ RB91X_LATCH_GPIO(3) #define RB91X_GPIO_NAND_RDY RB91X_LATCH_GPIO(4) #define RB91X_GPIO_NLE RB91X_LATCH_GPIO(11) @@ -76,6 +78,14 @@ #define RB91X_GPIO_NAND_CLE RB91X_LATCH_GPIO(14) #define RB91X_GPIO_NAND_ALE RB91X_LATCH_GPIO(15) +#define RB91X_GPIO_LED_1 RB91X_SSR_GPIO(RB91X_SSR_BIT_LED1) +#define RB91X_GPIO_LED_2 RB91X_SSR_GPIO(RB91X_SSR_BIT_LED2) +#define RB91X_GPIO_LED_3 RB91X_SSR_GPIO(RB91X_SSR_BIT_LED3) +#define RB91X_GPIO_LED_4 RB91X_SSR_GPIO(RB91X_SSR_BIT_LED4) +#define RB91X_GPIO_LED_5 RB91X_SSR_GPIO(RB91X_SSR_BIT_LED5) +#define RB91X_GPIO_USB_POWER RB91X_SSR_GPIO(RB91X_SSR_BIT_USB_POWER) +#define RB91X_GPIO_PCIE_POWER RB91X_SSR_GPIO(RB91X_SSR_BIT_PCIE_POWER) + struct rb_board_info { const char *name; u32 flags; @@ -175,6 +185,44 @@ static struct ath79_spi_platform_data rb711gr100_spi_data __initdata = { .num_chipselect = 2, }; +static struct gpio_led rb711gr100_leds[] __initdata = { + { + .name = "rb:green:led1", + .gpio = RB91X_GPIO_LED_1, + .active_low = 0, + }, + { + .name = "rb:green:led2", + .gpio = RB91X_GPIO_LED_2, + .active_low = 0, + }, + { + .name = "rb:green:led3", + .gpio = RB91X_GPIO_LED_3, + .active_low = 0, + }, + { + .name = "rb:green:led4", + .gpio = RB91X_GPIO_LED_4, + .active_low = 0, + }, + { + .name = "rb:green:led5", + .gpio = RB91X_GPIO_LED_5, + .active_low = 0, + }, + { + .name = "rb:green:user", + .gpio = RB91X_GPIO_LED_USER, + .active_low = 0, + }, + { + .name = "rb:green:power", + .gpio = RB91X_GPIO_LED_POWER, + .active_low = 0, + }, +}; + static void __init rb711gr100_init_partitions(const struct rb_info *info) { rb711gr100_spi_partitions[0].size = info->hard_cfg_offs; @@ -266,6 +314,9 @@ static void __init rb711gr100_setup(void) &rb711gr100_gpio_latch_data, sizeof(rb711gr100_gpio_latch_data)); + ath79_register_leds_gpio(-1, ARRAY_SIZE(rb711gr100_leds), + rb711gr100_leds); + flags = rb711gr100_get_flags(info); if (flags & RB91X_FLAG_USB) |