Works as advertised.
Post by Felix Kaechele---
.../ar71xx/files/arch/mips/ath79/mach-mynet-n600.c | 66 ++++++++++++++++------
1 file changed, 48 insertions(+), 18 deletions(-)
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n600.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n600.c
index 476cff8..861528e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n600.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n600.c
@@ -34,14 +34,22 @@
#define MYNET_N600_GPIO_LED_INTERNET 12
#define MYNET_N600_GPIO_LED_WPS 13
-#define MYNET_N600_GPIO_LED_LAN1 4
-#define MYNET_N600_GPIO_LED_LAN2 3
-#define MYNET_N600_GPIO_LED_LAN3 2
-#define MYNET_N600_GPIO_LED_LAN4 1
+#define MYNET_N600_GPIO_LED_LAN1_GREEN 4
+#define MYNET_N600_GPIO_LED_LAN2_GREEN 3
+#define MYNET_N600_GPIO_LED_LAN3_GREEN 2
+#define MYNET_N600_GPIO_LED_LAN4_GREEN 1
+
+#define MYNET_N600_GPIO_LED_LAN1_YELLOW 22
+#define MYNET_N600_GPIO_LED_LAN2_YELLOW 21
+#define MYNET_N600_GPIO_LED_LAN3_YELLOW 20
+#define MYNET_N600_GPIO_LED_LAN4_YELLOW 19
#define MYNET_N600_GPIO_BTN_RESET 16
#define MYNET_N600_GPIO_BTN_WPS 17
+#define MYNET_N600_GPIO_EXTERNAL_LNA0 14
+#define MYNET_N600_GPIO_EXTERNAL_LNA1 15
+
#define MYNET_N600_KEYS_POLL_INTERVAL 20 /* msecs */
#define MYNET_N600_KEYS_DEBOUNCE_INTERVAL (3 * MYNET_N600_KEYS_POLL_INTERVAL)
@@ -76,22 +84,42 @@ static struct gpio_led mynet_n600_leds_gpio[] __initdata = {
},
{
.name = "wd:green:lan1",
- .gpio = MYNET_N600_GPIO_LED_LAN1,
+ .gpio = MYNET_N600_GPIO_LED_LAN1_GREEN,
.active_low = 1,
},
{
.name = "wd:green:lan2",
- .gpio = MYNET_N600_GPIO_LED_LAN2,
+ .gpio = MYNET_N600_GPIO_LED_LAN2_GREEN,
.active_low = 1,
},
{
.name = "wd:green:lan3",
- .gpio = MYNET_N600_GPIO_LED_LAN3,
+ .gpio = MYNET_N600_GPIO_LED_LAN3_GREEN,
.active_low = 1,
},
{
.name = "wd:green:lan4",
- .gpio = MYNET_N600_GPIO_LED_LAN4,
+ .gpio = MYNET_N600_GPIO_LED_LAN4_GREEN,
+ .active_low = 1,
+ },
+ {
+ .name = "wd:yellow:lan1",
+ .gpio = MYNET_N600_GPIO_LED_LAN1_YELLOW,
+ .active_low = 1,
+ },
+ {
+ .name = "wd:yellow:lan2",
+ .gpio = MYNET_N600_GPIO_LED_LAN2_YELLOW,
+ .active_low = 1,
+ },
+ {
+ .name = "wd:yellow:lan3",
+ .gpio = MYNET_N600_GPIO_LED_LAN3_YELLOW,
+ .active_low = 1,
+ },
+ {
+ .name = "wd:yellow:lan4",
+ .gpio = MYNET_N600_GPIO_LED_LAN4_YELLOW,
.active_low = 1,
},
};
@@ -135,16 +163,6 @@ static void __init mynet_n600_setup(void)
ath79_register_m25p80(NULL);
- ath79_gpio_output_select(MYNET_N600_GPIO_LED_LAN1,
- AR934X_GPIO_OUT_GPIO);
- ath79_gpio_output_select(MYNET_N600_GPIO_LED_LAN2,
- AR934X_GPIO_OUT_GPIO);
- ath79_gpio_output_select(MYNET_N600_GPIO_LED_LAN3,
- AR934X_GPIO_OUT_GPIO);
- ath79_gpio_output_select(MYNET_N600_GPIO_LED_LAN4,
- AR934X_GPIO_OUT_GPIO);
- ath79_gpio_output_select(MYNET_N600_GPIO_LED_INTERNET,
- AR934X_GPIO_OUT_GPIO);
ath79_register_leds_gpio(-1, ARRAY_SIZE(mynet_n600_leds_gpio),
mynet_n600_leds_gpio);
@@ -152,6 +170,18 @@ static void __init mynet_n600_setup(void)
ARRAY_SIZE(mynet_n600_gpio_keys),
mynet_n600_gpio_keys);
+ /*
+ * Control signal for external LNAs 0 and 1
+ * board/ar7240/db12x/alpha_gpio.c
+ */
+ gpio_request_one(MYNET_N600_GPIO_EXTERNAL_LNA0,
+ GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
+ "External LNA0");
+ gpio_request_one(MYNET_N600_GPIO_EXTERNAL_LNA1,
+ GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
+ "External LNA1");
+
mynet_n600_get_mac("wlan24mac=", tmpmac);
ath79_register_wmac(art + MYNET_N600_WMAC_CALDATA_OFFSET, tmpmac);