aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood/netspace_v2-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-kirkwood/netspace_v2-setup.c')
-rw-r--r--arch/arm/mach-kirkwood/netspace_v2-setup.c59
1 files changed, 34 insertions, 25 deletions
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
index 9a064065bebe..3ae158d72681 100644
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c
@@ -182,8 +182,14 @@ static struct platform_device netspace_v2_gpio_buttons = {
182 182
183static struct gpio_led netspace_v2_gpio_led_pins[] = { 183static struct gpio_led netspace_v2_gpio_led_pins[] = {
184 { 184 {
185 .name = "ns_v2:red:fail", 185 .name = "ns_v2:blue:sata",
186 .gpio = NETSPACE_V2_GPIO_RED_LED, 186 .default_trigger = "default-on",
187 .gpio = NETSPACE_V2_GPIO_BLUE_LED_CMD,
188 .active_low = 1,
189 },
190 {
191 .name = "ns_v2:red:fail",
192 .gpio = NETSPACE_V2_GPIO_RED_LED,
187 }, 193 },
188}; 194};
189 195
@@ -202,30 +208,19 @@ static struct platform_device netspace_v2_gpio_leds = {
202 208
203static void __init netspace_v2_gpio_leds_init(void) 209static void __init netspace_v2_gpio_leds_init(void)
204{ 210{
205 platform_device_register(&netspace_v2_gpio_leds); 211 int err;
206 212
207 /* 213 /* Configure register slow_led to allow SATA activity LED blinking */
208 * Configure the front blue LED to blink in relation with the SATA 214 err = gpio_request(NETSPACE_V2_GPIO_BLUE_LED_SLOW, "blue LED slow");
209 * activity. 215 if (err == 0) {
210 */ 216 err = gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 0);
211 if (gpio_request(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 217 if (err)
212 "SATA blue LED slow") != 0) 218 gpio_free(NETSPACE_V2_GPIO_BLUE_LED_SLOW);
213 return; 219 }
214 if (gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 0) != 0) 220 if (err)
215 goto err_free_1; 221 pr_err("netspace_v2: failed to configure blue LED slow GPIO\n");
216 if (gpio_request(NETSPACE_V2_GPIO_BLUE_LED_CMD, 222
217 "SATA blue LED command") != 0) 223 platform_device_register(&netspace_v2_gpio_leds);
218 goto err_free_1;
219 if (gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_CMD, 0) != 0)
220 goto err_free_2;
221
222 return;
223
224err_free_2:
225 gpio_free(NETSPACE_V2_GPIO_BLUE_LED_CMD);
226err_free_1:
227 gpio_free(NETSPACE_V2_GPIO_BLUE_LED_SLOW);
228 pr_err("netspace_v2: failed to configure SATA blue LED\n");
229} 224}
230 225
231/***************************************************************************** 226/*****************************************************************************
@@ -314,6 +309,7 @@ static void __init netspace_v2_init(void)
314 pr_err("netspace_v2: failed to configure power-off GPIO\n"); 309 pr_err("netspace_v2: failed to configure power-off GPIO\n");
315} 310}
316 311
312#ifdef CONFIG_MACH_NETSPACE_V2
317MACHINE_START(NETSPACE_V2, "LaCie Network Space v2") 313MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
318 .phys_io = KIRKWOOD_REGS_PHYS_BASE, 314 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
319 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, 315 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
@@ -323,3 +319,16 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
323 .init_irq = kirkwood_init_irq, 319 .init_irq = kirkwood_init_irq,
324 .timer = &netspace_v2_timer, 320 .timer = &netspace_v2_timer,
325MACHINE_END 321MACHINE_END
322#endif
323
324#ifdef CONFIG_MACH_INETSPACE_V2
325MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
326 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
327 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
328 .boot_params = 0x00000100,
329 .init_machine = netspace_v2_init,
330 .map_io = kirkwood_map_io,
331 .init_irq = kirkwood_init_irq,
332 .timer = &netspace_v2_timer,
333MACHINE_END
334#endif