[OpenWrt-Devel] [PATCH 11/11] ar71xx: do general formatting on wnr2000-v4

Michael J. Bazzinotti bazz at cs.umb.edu
Mon Apr 20 19:24:22 EDT 2015


From: "Michael J. Bazzinotti" <mbazzinotti at gmail.com>

Signed-off-by: Michael J. Bazzinotti <mbazzinotti at gmail.com>
---
 .../ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c | 93 ++++++++++++----------
 1 file changed, 51 insertions(+), 42 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c
index 0942dc8..e61a707 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c
@@ -30,30 +30,31 @@
 #include "machtypes.h"
 
 /* AR9341 GPIOs */
-#define WNR2000V4_GPIO_LED_WAN_AMBER   22
-#define WNR2000V4_GPIO_LED_WAN_GREEN   17
-#define WNR2000V4_GPIO_LED_WPS 2
-#define WNR2000V4_GPIO_LED_WLAN 12
-#define WNR2000V4_GPIO_LED_LAN1_GREEN  13
-#define WNR2000V4_GPIO_LED_LAN2_GREEN  14
-#define WNR2000V4_GPIO_LED_LAN3_GREEN  15
-#define WNR2000V4_GPIO_LED_LAN4_GREEN  16
-#define WNR2000V4_GPIO_LED_LAN1_AMBER  18
-#define WNR2000V4_GPIO_LED_LAN2_AMBER  19
-#define WNR2000V4_GPIO_LED_LAN3_AMBER  20
-#define WNR2000V4_GPIO_LED_LAN4_AMBER  21
-#define STATUS_LED_GPIO         1
-#define WNR2000V4_GPIO_LED_PWR_GREEN    0
-
-#define WNR2000V4_GPIO_BTN_WPS      3
-#define WNR2000V4_GPIO_BTN_RESET    4
-#define WNR2000V4_GPIO_BTN_WLAN     11
-
-#define WNR2000V4_KEYS_POLL_INTERVAL	20	/* msecs */
-#define WNR2000V4_KEYS_DEBOUNCE_INTERVAL	(3 * WNR2000V4_KEYS_POLL_INTERVAL)
-
-#define WNR2000V4_MAC0_OFFSET		0
-#define WNR2000V4_MAC1_OFFSET		6
+#define WNR2000V4_GPIO_LED_PWR_GREEN      0
+#define WNR2000V4_GPIO_LED_PWR_AMBER      1
+#define WNR2000V4_GPIO_LED_WPS            2
+#define WNR2000V4_GPIO_LED_WLAN           12
+#define WNR2000V4_GPIO_LED_LAN1_GREEN     13
+#define WNR2000V4_GPIO_LED_LAN2_GREEN     14
+#define WNR2000V4_GPIO_LED_LAN3_GREEN     15
+#define WNR2000V4_GPIO_LED_LAN4_GREEN     16
+#define WNR2000V4_GPIO_LED_LAN1_AMBER     18
+#define WNR2000V4_GPIO_LED_LAN2_AMBER     19
+#define WNR2000V4_GPIO_LED_LAN3_AMBER     20
+#define WNR2000V4_GPIO_LED_LAN4_AMBER     21
+#define WNR2000V4_GPIO_LED_WAN_GREEN      17
+#define WNR2000V4_GPIO_LED_WAN_AMBER      22
+/* Buttons */
+#define WNR2000V4_GPIO_BTN_WPS            3
+#define WNR2000V4_GPIO_BTN_RESET          4
+#define WNR2000V4_GPIO_BTN_WLAN           11
+#define WNR2000V4_KEYS_POLL_INTERVAL      20      /* msecs */
+#define WNR2000V4_KEYS_DEBOUNCE_INTERVAL  (3 * WNR2000V4_KEYS_POLL_INTERVAL)
+
+
+/* ART offsets */
+#define WNR2000V4_MAC0_OFFSET             0       /* WAN/WLAN0 MAC   */
+#define WNR2000V4_MAC1_OFFSET             6       /* Eth-switch0 MAC */
 
 static struct gpio_led wnr2000v4_leds_gpio[] __initdata = {
 	{
@@ -61,23 +62,20 @@ static struct gpio_led wnr2000v4_leds_gpio[] __initdata = {
 		.gpio		= WNR2000V4_GPIO_LED_PWR_GREEN,
 		.active_low	= 1,
-        .default_trigger = "default-on",
+		.default_trigger = "default-on",
-	}, {
-		.name		= "netgear:green:wan",
-		.gpio		= WNR2000V4_GPIO_LED_WAN_GREEN,
-		.active_low	= 1,
-	}, {
-		.name		= "netgear:amber:wan",
-		.gpio		= WNR2000V4_GPIO_LED_WAN_AMBER,
+	},
+	{
+		.name		= "netgear:amber:status",
+		.gpio		= WNR2000V4_GPIO_LED_PWR_AMBER,
 		.active_low	= 1,
 	},
 	{
-		.name		= "netgear:green:wps",
-		.gpio		= WNR2000V4_GPIO_LED_WPS,
+		.name		= "netgear:green:wan",
+		.gpio		= WNR2000V4_GPIO_LED_WAN_GREEN,
 		.active_low	= 1,
 	},
 	{
-		.name		= "netgear:amber:status",
-		.gpio		= STATUS_LED_GPIO,
+		.name		= "netgear:amber:wan",
+		.gpio		= WNR2000V4_GPIO_LED_WAN_AMBER,
 		.active_low	= 1,
 	},
 	{
@@ -90,15 +88,18 @@ static struct gpio_led wnr2000v4_leds_gpio[] __initdata = {
 		.name		= "netgear:green:lan1",
 		.gpio		= WNR2000V4_GPIO_LED_LAN1_GREEN,
 		.active_low	= 1,
-	}, {
+	},
+	{
 		.name		= "netgear:green:lan2",
 		.gpio		= WNR2000V4_GPIO_LED_LAN2_GREEN,
 		.active_low	= 1,
-	}, {
+	},
+	{
 		.name		= "netgear:green:lan3",
 		.gpio		= WNR2000V4_GPIO_LED_LAN3_GREEN,
 		.active_low	= 1,
-	}, {
+	},
+	{
 		.name		= "netgear:green:lan4",
 		.gpio		= WNR2000V4_GPIO_LED_LAN4_GREEN,
 		.active_low	= 1,
@@ -107,19 +108,27 @@ static struct gpio_led wnr2000v4_leds_gpio[] __initdata = {
 		.name		= "netgear:amber:lan1",
 		.gpio		= WNR2000V4_GPIO_LED_LAN1_AMBER,
 		.active_low	= 1,
-	}, {
+	},
+	{
 		.name		= "netgear:amber:lan2",
 		.gpio		= WNR2000V4_GPIO_LED_LAN2_AMBER,
 		.active_low	= 1,
-	}, {
+	},
+	{
 		.name		= "netgear:amber:lan3",
 		.gpio		= WNR2000V4_GPIO_LED_LAN3_AMBER,
 		.active_low	= 1,
-	}, {
+	},
+	{
 		.name		= "netgear:amber:lan4",
 		.gpio		= WNR2000V4_GPIO_LED_LAN4_AMBER,
 		.active_low	= 1,
-	}
+	},
+	{
+		.name		= "netgear:green:wps",
+		.gpio		= WNR2000V4_GPIO_LED_WPS,
+		.active_low	= 1,
+	},
 };
 
 static struct gpio_keys_button wnr2000v4_gpio_keys[] __initdata = {
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list