Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187428
b: refs/heads/master
c: 1afeea8
h: refs/heads/master
v: v3
  • Loading branch information
Simon Guinot authored and Nicolas Pitre committed Feb 10, 2010
1 parent a590581 commit 299272b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca9cea939932a0a64fee9d83b3c631431359446f
refs/heads/master: 1afeea84bd821e9a8c1c6606ba677bc229dd57de
45 changes: 20 additions & 25 deletions trunk/arch/arm/mach-kirkwood/netspace_v2-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,14 @@ static struct platform_device netspace_v2_gpio_buttons = {

static struct gpio_led netspace_v2_gpio_led_pins[] = {
{
.name = "ns_v2:red:fail",
.gpio = NETSPACE_V2_GPIO_RED_LED,
.name = "ns_v2:blue:sata",
.default_trigger = "default-on",
.gpio = NETSPACE_V2_GPIO_BLUE_LED_CMD,
.active_low = 1,
},
{
.name = "ns_v2:red:fail",
.gpio = NETSPACE_V2_GPIO_RED_LED,
},
};

Expand All @@ -202,30 +208,19 @@ static struct platform_device netspace_v2_gpio_leds = {

static void __init netspace_v2_gpio_leds_init(void)
{
platform_device_register(&netspace_v2_gpio_leds);
int err;

/*
* Configure the front blue LED to blink in relation with the SATA
* activity.
*/
if (gpio_request(NETSPACE_V2_GPIO_BLUE_LED_SLOW,
"SATA blue LED slow") != 0)
return;
if (gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 0) != 0)
goto err_free_1;
if (gpio_request(NETSPACE_V2_GPIO_BLUE_LED_CMD,
"SATA blue LED command") != 0)
goto err_free_1;
if (gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_CMD, 0) != 0)
goto err_free_2;

return;

err_free_2:
gpio_free(NETSPACE_V2_GPIO_BLUE_LED_CMD);
err_free_1:
gpio_free(NETSPACE_V2_GPIO_BLUE_LED_SLOW);
pr_err("netspace_v2: failed to configure SATA blue LED\n");
/* Configure register slow_led to allow SATA activity LED blinking */
err = gpio_request(NETSPACE_V2_GPIO_BLUE_LED_SLOW, "blue LED slow");
if (err == 0) {
err = gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 0);
if (err)
gpio_free(NETSPACE_V2_GPIO_BLUE_LED_SLOW);
}
if (err)
pr_err("netspace_v2: failed to configure blue LED slow GPIO\n");

platform_device_register(&netspace_v2_gpio_leds);
}

/*****************************************************************************
Expand Down

0 comments on commit 299272b

Please sign in to comment.