summaryrefslogtreecommitdiff
path: root/target/linux/brcm47xx/patches-3.10/125-MIPS-BCM47XX-Convert-WNDR4500-to-new-syntax.patch
blob: 00f962aa853514f9daec90332189d2928d1499e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
From 2d842783d4aaa25803e92f663869ea64a4eddd00 Mon Sep 17 00:00:00 2001
From: Rafa? Mi?ecki <zajec5@gmail.com>
Date: Fri, 3 Jan 2014 09:37:42 +0100
Subject: [PATCH] MIPS: BCM47XX: Convert WNDR4500 to new syntax

Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
 arch/mips/bcm47xx/buttons.c |   22 ++++--------------
 arch/mips/bcm47xx/leds.c    |   53 ++++++++-----------------------------------
 2 files changed, 14 insertions(+), 61 deletions(-)

--- a/arch/mips/bcm47xx/buttons.c
+++ b/arch/mips/bcm47xx/buttons.c
@@ -304,22 +304,10 @@ bcm47xx_buttons_netgear_wndr3700v3[] __i
 };
 
 static const struct gpio_keys_button
-bcm47xx_buttons_netgear_wndr4500_v1[] __initconst = {
-	{
-		.code		= KEY_WPS_BUTTON,
-		.gpio		= 4,
-		.active_low	= 1,
-	},
-	{
-		.code		= KEY_RFKILL,
-		.gpio		= 5,
-		.active_low	= 1,
-	},
-	{
-		.code		= KEY_RESTART,
-		.gpio		= 6,
-		.active_low	= 1,
-	},
+bcm47xx_buttons_netgear_wndr4500v1[] __initconst = {
+	BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
+	BCM47XX_GPIO_KEY(5, KEY_RFKILL),
+	BCM47XX_GPIO_KEY(6, KEY_RESTART),
 };
 
 static const struct gpio_keys_button
@@ -515,7 +503,7 @@ int __init bcm47xx_buttons_register(void
 		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3700v3);
 		break;
 	case BCM47XX_BOARD_NETGEAR_WNDR4500V1:
-		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500_v1);
+		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500v1);
 		break;
 	case BCM47XX_BOARD_NETGEAR_WNR834BV2:
 		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr834bv2);
--- a/arch/mips/bcm47xx/leds.c
+++ b/arch/mips/bcm47xx/leds.c
@@ -332,49 +332,14 @@ bcm47xx_leds_netgear_wndr3400v1[] __init
 };
 
 static const struct gpio_led
-bcm47xx_leds_netgear_wndr4500_v1_leds[] __initconst = {
-	{
-		.name		= "bcm47xx:green:wps",
-		.gpio		= 1,
-		.active_low	= 1,
-		.default_state	= LEDS_GPIO_DEFSTATE_KEEP,
-	},
-	{
-		.name		= "bcm47xx:green:power",
-		.gpio		= 2,
-		.active_low	= 1,
-		.default_state	= LEDS_GPIO_DEFSTATE_KEEP,
-	},
-	{
-		.name		= "bcm47xx:orange:power",
-		.gpio		= 3,
-		.active_low	= 1,
-		.default_state	= LEDS_GPIO_DEFSTATE_KEEP,
-	},
-	{
-		.name		= "bcm47xx:green:usb1",
-		.gpio		= 8,
-		.active_low	= 1,
-		.default_state	= LEDS_GPIO_DEFSTATE_KEEP,
-	},
-	{
-		.name		= "bcm47xx:green:2ghz",
-		.gpio		= 9,
-		.active_low	= 1,
-		.default_state	= LEDS_GPIO_DEFSTATE_KEEP,
-	},
-	{
-		.name		= "bcm47xx:blue:5ghz",
-		.gpio		= 11,
-		.active_low	= 1,
-		.default_state	= LEDS_GPIO_DEFSTATE_KEEP,
-	},
-	{
-		.name		= "bcm47xx:green:usb2",
-		.gpio		= 14,
-		.active_low	= 1,
-		.default_state	= LEDS_GPIO_DEFSTATE_KEEP,
-	},
+bcm47xx_leds_netgear_wndr4500v1[] __initconst = {
+	BCM47XX_GPIO_LED(1, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
+	BCM47XX_GPIO_LED(2, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
+	BCM47XX_GPIO_LED(3, "amber", "power", 1, LEDS_GPIO_DEFSTATE_OFF),
+	BCM47XX_GPIO_LED(8, "green", "usb1", 1, LEDS_GPIO_DEFSTATE_OFF),
+	BCM47XX_GPIO_LED(9, "green", "2ghz", 1, LEDS_GPIO_DEFSTATE_OFF),
+	BCM47XX_GPIO_LED(11, "blue", "5ghz", 1, LEDS_GPIO_DEFSTATE_OFF),
+	BCM47XX_GPIO_LED(14, "green", "usb2", 1, LEDS_GPIO_DEFSTATE_OFF),
 };
 
 static const struct gpio_led
@@ -548,7 +513,7 @@ void __init bcm47xx_leds_register(void)
 		bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr3400v1);
 		break;
 	case BCM47XX_BOARD_NETGEAR_WNDR4500V1:
-		bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr4500_v1_leds);
+		bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr4500v1);
 		break;
 	case BCM47XX_BOARD_NETGEAR_WNR834BV2:
 		bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2);