aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2014-02-23 08:11:53 +0000
committerGabor Juhos <juhosg@openwrt.org>2014-02-23 08:11:53 +0000
commit133fb261b09190d258d638299d37a62b54542f5c (patch)
treeba5738bd5d1914cbd1b6f299160495c719db7b96 /target/linux/ar71xx
parent2ad25c9d1deaccdb8d469af26351f9dbbcf93838 (diff)
downloadupstream-133fb261b09190d258d638299d37a62b54542f5c.tar.gz
upstream-133fb261b09190d258d638299d37a62b54542f5c.tar.bz2
upstream-133fb261b09190d258d638299d37a62b54542f5c.zip
ar71xx: rb91x: register GPIO LEDs
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39704 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c51
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)