Commit 1afeea84 authored by Simon Guinot's avatar Simon Guinot Committed by Nicolas Pitre

[ARM] Kirkwood: define SATA LED for netspace_v2

This patch add a GPIO LED named "ns_v2:blue:sata" which can be used to
enable or disable SATA activity LED blinking.
Signed-off-by: default avatarSimon Guinot <sguinot@lacie.com>
Signed-off-by: default avatarNicolas Pitre <nico@marvell.com>
parent ca9cea93
...@@ -182,8 +182,14 @@ static struct platform_device netspace_v2_gpio_buttons = { ...@@ -182,8 +182,14 @@ static struct platform_device netspace_v2_gpio_buttons = {
static struct gpio_led netspace_v2_gpio_led_pins[] = { static struct gpio_led netspace_v2_gpio_led_pins[] = {
{ {
.name = "ns_v2:red:fail", .name = "ns_v2:blue:sata",
.gpio = NETSPACE_V2_GPIO_RED_LED, .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,
}, },
}; };
...@@ -202,30 +208,19 @@ static struct platform_device netspace_v2_gpio_leds = { ...@@ -202,30 +208,19 @@ static struct platform_device netspace_v2_gpio_leds = {
static void __init netspace_v2_gpio_leds_init(void) static void __init netspace_v2_gpio_leds_init(void)
{ {
platform_device_register(&netspace_v2_gpio_leds); int err;
/* /* Configure register slow_led to allow SATA activity LED blinking */
* Configure the front blue LED to blink in relation with the SATA err = gpio_request(NETSPACE_V2_GPIO_BLUE_LED_SLOW, "blue LED slow");
* activity. if (err == 0) {
*/ err = gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 0);
if (gpio_request(NETSPACE_V2_GPIO_BLUE_LED_SLOW, if (err)
"SATA blue LED slow") != 0) gpio_free(NETSPACE_V2_GPIO_BLUE_LED_SLOW);
return; }
if (gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 0) != 0) if (err)
goto err_free_1; pr_err("netspace_v2: failed to configure blue LED slow GPIO\n");
if (gpio_request(NETSPACE_V2_GPIO_BLUE_LED_CMD,
"SATA blue LED command") != 0) platform_device_register(&netspace_v2_gpio_leds);
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");
} }
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment