aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
diff options
context:
space:
mode:
authorSimon Guinot <sguinot@lacie.com>2010-02-09 15:20:56 -0500
committerNicolas Pitre <nico@fluxnic.net>2010-02-09 21:05:49 -0500
commit1afeea84bd821e9a8c1c6606ba677bc229dd57de (patch)
tree4864ae35df6f64315cb06a6a8a747939144ca81a /arch/arm/mach-kirkwood
parentca9cea939932a0a64fee9d83b3c631431359446f (diff)
[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: Simon Guinot <sguinot@lacie.com> Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/netspace_v2-setup.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
index 4c1f4744fe62..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/*****************************************************************************