summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/files/arch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-12-14 20:21:42 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-12-14 20:21:42 +0000
commitb878f4a927e872889879d1bc49abc88ff6edb1ea (patch)
treea5c7bc7fb64431d1f6001957cff6106fe4ba4c44 /target/linux/ar71xx/files/arch
parente3017bc05e316ade69484923c2ea9c26cdc4802e (diff)
downloadmtk-20170518-b878f4a927e872889879d1bc49abc88ff6edb1ea.zip
mtk-20170518-b878f4a927e872889879d1bc49abc88ff6edb1ea.tar.gz
mtk-20170518-b878f4a927e872889879d1bc49abc88ff6edb1ea.tar.bz2
ar71xx: register extra leds behind the wireless mac on wzr-hp-g450h
SVN-Revision: 29531
Diffstat (limited to 'target/linux/ar71xx/files/arch')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.c6
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.h4
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g450h.c16
3 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.c b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.c
index 2b75f7b..7cd8c65 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.c
@@ -42,6 +42,12 @@ static int ap91_pci_plat_dev_init(struct pci_dev *dev)
return 0;
}
+__init void ap91_pci_setup_wmac_leds(struct gpio_led *leds, int num_leds)
+{
+ ap91_wmac_data.leds = leds;
+ ap91_wmac_data.num_leds = num_leds;
+}
+
__init void ap91_pci_setup_wmac_led_pin(int pin)
{
ap91_wmac_data.led_pin = pin;
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.h b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.h
index e471083..ebcbc47 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.h
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-pci.h
@@ -11,14 +11,18 @@
#ifndef _AR71XX_DEV_AP91_PCI_H
#define _AR71XX_DEV_AP91_PCI_H
+#include <linux/leds.h>
+
#if defined(CONFIG_AR71XX_DEV_AP91_PCI)
void ap91_pci_init(u8 *cal_data, u8 *mac_addr) __init;
void ap91_pci_setup_wmac_led_pin(int pin) __init;
void ap91_pci_setup_wmac_gpio(u32 mask, u32 val) __init;
+void ap91_pci_setup_wmac_leds(struct gpio_led *leds, int num_leds) __init;
#else
static inline void ap91_pci_init(u8 *cal_data, u8 *mac_addr) { }
static inline void ap91_pci_setup_wmac_led_pin(int pin) { }
static inline void ap91_pci_setup_wmac_gpio(u32 mask, u32 gpio) { }
+static inline void ap91_pci_setup_wmac_leds(struct gpio_led *leds, int num_leds) { };
#endif
#endif /* _AR71XX_DEV_AP91_PCI_H */
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g450h.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g450h.c
index f9cc025..03376bb 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g450h.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g450h.c
@@ -82,6 +82,20 @@ static struct gpio_led wzrhpg450h_leds_gpio[] __initdata = {
},
};
+
+static struct gpio_led wzrhpg450h_wmac_leds_gpio[] = {
+ {
+ .name = "buffalo:blue:movie_engine",
+ .gpio = 13,
+ .active_low = 1,
+ },
+ {
+ .name = "buffalo:green:router",
+ .gpio = 14,
+ .active_low = 1,
+ },
+};
+
static struct gpio_keys_button wzrhpg450h_gpio_keys[] __initdata = {
{
.desc = "reset",
@@ -151,6 +165,8 @@ static void __init wzrhpg450h_init(void)
ap91_pci_init(ee, NULL);
ap91_pci_setup_wmac_led_pin(15);
+ ap91_pci_setup_wmac_leds(wzrhpg450h_wmac_leds_gpio,
+ ARRAY_SIZE(wzrhpg450h_wmac_leds_gpio));
}
MIPS_MACHINE(AR71XX_MACH_WZR_HP_G450H, "WZR-HP-G450H", "Buffalo WZR-HP-G450H",