diff options
author | Jamie Lentin <jm@lentin.co.uk> | 2012-07-19 16:30:58 -0400 |
---|---|---|
committer | Andrew Lunn <andrew@lunn.ch> | 2012-07-27 10:49:45 -0400 |
commit | 09059e9f29d6167511b8df0f6518e8a0b1bd4c70 (patch) | |
tree | 4ce170f76b32717f0bd1e7fae18ed55e2eabf100 /arch/arm | |
parent | 55650d4e5b0b8de785e4682f4149951e2ce0e731 (diff) |
ARM: Kirkwood: Replace DNS-320/DNS-325 leds with dt bindings
Replace code in board-dnskw with the equivalent devicetree bindings.
Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boot/dts/kirkwood-dns320.dts | 25 | ||||
-rw-r--r-- | arch/arm/boot/dts/kirkwood-dns325.dts | 25 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-dnskw.c | 90 |
3 files changed, 50 insertions, 90 deletions
diff --git a/arch/arm/boot/dts/kirkwood-dns320.dts b/arch/arm/boot/dts/kirkwood-dns320.dts index 6fb0d7e56096..9368382eac2b 100644 --- a/arch/arm/boot/dts/kirkwood-dns320.dts +++ b/arch/arm/boot/dts/kirkwood-dns320.dts | |||
@@ -15,6 +15,31 @@ | |||
15 | bootargs = "console=ttyS0,115200n8 earlyprintk"; | 15 | bootargs = "console=ttyS0,115200n8 earlyprintk"; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | gpio-leds { | ||
19 | compatible = "gpio-leds"; | ||
20 | blue-power { | ||
21 | label = "dns320:blue:power"; | ||
22 | gpios = <&gpio0 26 1>; /* GPIO 26 Active Low */ | ||
23 | linux,default-trigger = "default-on"; | ||
24 | }; | ||
25 | blue-usb { | ||
26 | label = "dns320:blue:usb"; | ||
27 | gpios = <&gpio1 11 1>; /* GPIO 43 Active Low */ | ||
28 | }; | ||
29 | orange-l_hdd { | ||
30 | label = "dns320:orange:l_hdd"; | ||
31 | gpios = <&gpio0 28 1>; /* GPIO 28 Active Low */ | ||
32 | }; | ||
33 | orange-r_hdd { | ||
34 | label = "dns320:orange:r_hdd"; | ||
35 | gpios = <&gpio0 27 1>; /* GPIO 27 Active Low */ | ||
36 | }; | ||
37 | orange-usb { | ||
38 | label = "dns320:orange:usb"; | ||
39 | gpios = <&gpio1 3 1>; /* GPIO 35 Active Low */ | ||
40 | }; | ||
41 | }; | ||
42 | |||
18 | ocp@f1000000 { | 43 | ocp@f1000000 { |
19 | serial@12000 { | 44 | serial@12000 { |
20 | clock-frequency = <166666667>; | 45 | clock-frequency = <166666667>; |
diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts index debb3703dfe7..a24597044d5f 100644 --- a/arch/arm/boot/dts/kirkwood-dns325.dts +++ b/arch/arm/boot/dts/kirkwood-dns325.dts | |||
@@ -15,6 +15,31 @@ | |||
15 | bootargs = "console=ttyS0,115200n8 earlyprintk"; | 15 | bootargs = "console=ttyS0,115200n8 earlyprintk"; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | gpio-leds { | ||
19 | compatible = "gpio-leds"; | ||
20 | white-power { | ||
21 | label = "dns325:white:power"; | ||
22 | gpios = <&gpio0 26 1>; /* GPIO 26 Active Low */ | ||
23 | linux,default-trigger = "default-on"; | ||
24 | }; | ||
25 | white-usb { | ||
26 | label = "dns325:white:usb"; | ||
27 | gpios = <&gpio1 11 1>; /* GPIO 43 Active Low */ | ||
28 | }; | ||
29 | red-l_hdd { | ||
30 | label = "dns325:red:l_hdd"; | ||
31 | gpios = <&gpio0 28 1>; /* GPIO 28 Active Low */ | ||
32 | }; | ||
33 | red-r_hdd { | ||
34 | label = "dns325:red:r_hdd"; | ||
35 | gpios = <&gpio0 27 1>; /* GPIO 27 Active Low */ | ||
36 | }; | ||
37 | red-usb { | ||
38 | label = "dns325:red:usb"; | ||
39 | gpios = <&gpio0 29 1>; /* GPIO 29 Active Low */ | ||
40 | }; | ||
41 | }; | ||
42 | |||
18 | ocp@f1000000 { | 43 | ocp@f1000000 { |
19 | i2c@11000 { | 44 | i2c@11000 { |
20 | status = "okay"; | 45 | status = "okay"; |
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c index 1c97efa7705e..aac9c90715c5 100644 --- a/arch/arm/mach-kirkwood/board-dnskw.c +++ b/arch/arm/mach-kirkwood/board-dnskw.c | |||
@@ -68,90 +68,6 @@ static unsigned int dnskw_mpp_config[] __initdata = { | |||
68 | 0 | 68 | 0 |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static struct gpio_led dns325_led_pins[] = { | ||
72 | { | ||
73 | .name = "dns325:white:power", | ||
74 | .gpio = 26, | ||
75 | .active_low = 1, | ||
76 | .default_trigger = "default-on", | ||
77 | }, | ||
78 | { | ||
79 | .name = "dns325:white:usb", | ||
80 | .gpio = 43, | ||
81 | .active_low = 1, | ||
82 | }, | ||
83 | { | ||
84 | .name = "dns325:red:l_hdd", | ||
85 | .gpio = 28, | ||
86 | .active_low = 1, | ||
87 | }, | ||
88 | { | ||
89 | .name = "dns325:red:r_hdd", | ||
90 | .gpio = 27, | ||
91 | .active_low = 1, | ||
92 | }, | ||
93 | { | ||
94 | .name = "dns325:red:usb", | ||
95 | .gpio = 29, | ||
96 | .active_low = 1, | ||
97 | }, | ||
98 | }; | ||
99 | |||
100 | static struct gpio_led_platform_data dns325_led_data = { | ||
101 | .num_leds = ARRAY_SIZE(dns325_led_pins), | ||
102 | .leds = dns325_led_pins, | ||
103 | }; | ||
104 | |||
105 | static struct platform_device dns325_led_device = { | ||
106 | .name = "leds-gpio", | ||
107 | .id = -1, | ||
108 | .dev = { | ||
109 | .platform_data = &dns325_led_data, | ||
110 | }, | ||
111 | }; | ||
112 | |||
113 | static struct gpio_led dns320_led_pins[] = { | ||
114 | { | ||
115 | .name = "dns320:blue:power", | ||
116 | .gpio = 26, | ||
117 | .active_low = 1, | ||
118 | .default_trigger = "default-on", | ||
119 | }, | ||
120 | { | ||
121 | .name = "dns320:blue:usb", | ||
122 | .gpio = 43, | ||
123 | .active_low = 1, | ||
124 | }, | ||
125 | { | ||
126 | .name = "dns320:orange:l_hdd", | ||
127 | .gpio = 28, | ||
128 | .active_low = 1, | ||
129 | }, | ||
130 | { | ||
131 | .name = "dns320:orange:r_hdd", | ||
132 | .gpio = 27, | ||
133 | .active_low = 1, | ||
134 | }, | ||
135 | { | ||
136 | .name = "dns320:orange:usb", | ||
137 | .gpio = 35, | ||
138 | .active_low = 1, | ||
139 | }, | ||
140 | }; | ||
141 | |||
142 | static struct gpio_led_platform_data dns320_led_data = { | ||
143 | .num_leds = ARRAY_SIZE(dns320_led_pins), | ||
144 | .leds = dns320_led_pins, | ||
145 | }; | ||
146 | |||
147 | static struct platform_device dns320_led_device = { | ||
148 | .name = "leds-gpio", | ||
149 | .id = -1, | ||
150 | .dev = { | ||
151 | .platform_data = &dns320_led_data, | ||
152 | }, | ||
153 | }; | ||
154 | |||
155 | static struct gpio_keys_button dnskw_button_pins[] = { | 71 | static struct gpio_keys_button dnskw_button_pins[] = { |
156 | { | 72 | { |
157 | .code = KEY_POWER, | 73 | .code = KEY_POWER, |
@@ -237,12 +153,6 @@ void __init dnskw_init(void) | |||
237 | platform_device_register(&dnskw_button_device); | 153 | platform_device_register(&dnskw_button_device); |
238 | platform_device_register(&dnskw_fan_device); | 154 | platform_device_register(&dnskw_fan_device); |
239 | 155 | ||
240 | if (of_machine_is_compatible("dlink,dns-325")) | ||
241 | platform_device_register(&dns325_led_device); | ||
242 | |||
243 | else if (of_machine_is_compatible("dlink,dns-320")) | ||
244 | platform_device_register(&dns320_led_device); | ||
245 | |||
246 | /* Register power-off GPIO. */ | 156 | /* Register power-off GPIO. */ |
247 | if (gpio_request(36, "dnskw:power:off") == 0 | 157 | if (gpio_request(36, "dnskw:power:off") == 0 |
248 | && gpio_direction_output(36, 0) == 0) | 158 | && gpio_direction_output(36, 0) == 0) |