diff options
Diffstat (limited to 'arch/arm/mach-orion5x/dns323-setup.c')
-rw-r--r-- | arch/arm/mach-orion5x/dns323-setup.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index 685f34a9634b..fe0de1698edc 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c | |||
@@ -240,22 +240,23 @@ error_fail: | |||
240 | 240 | ||
241 | #define ORION_BLINK_HALF_PERIOD 100 /* ms */ | 241 | #define ORION_BLINK_HALF_PERIOD 100 /* ms */ |
242 | 242 | ||
243 | static int dns323_gpio_blink_set(unsigned gpio, | 243 | static int dns323_gpio_blink_set(unsigned gpio, int state, |
244 | unsigned long *delay_on, unsigned long *delay_off) | 244 | unsigned long *delay_on, unsigned long *delay_off) |
245 | { | 245 | { |
246 | static int value = 0; | ||
247 | 246 | ||
248 | if (!*delay_on && !*delay_off) | 247 | if (delay_on && delay_off && !*delay_on && !*delay_off) |
249 | *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD; | 248 | *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD; |
250 | 249 | ||
251 | if (ORION_BLINK_HALF_PERIOD == *delay_on | 250 | switch(state) { |
252 | && ORION_BLINK_HALF_PERIOD == *delay_off) { | 251 | case GPIO_LED_NO_BLINK_LOW: |
253 | value = !value; | 252 | case GPIO_LED_NO_BLINK_HIGH: |
254 | orion_gpio_set_blink(gpio, value); | 253 | orion_gpio_set_blink(gpio, 0); |
255 | return 0; | 254 | gpio_set_value(gpio, state); |
255 | break; | ||
256 | case GPIO_LED_BLINK: | ||
257 | orion_gpio_set_blink(gpio, 1); | ||
256 | } | 258 | } |
257 | 259 | return 0; | |
258 | return -EINVAL; | ||
259 | } | 260 | } |
260 | 261 | ||
261 | static struct gpio_led dns323_leds[] = { | 262 | static struct gpio_led dns323_leds[] = { |
@@ -263,6 +264,7 @@ static struct gpio_led dns323_leds[] = { | |||
263 | .name = "power:blue", | 264 | .name = "power:blue", |
264 | .gpio = DNS323_GPIO_LED_POWER2, | 265 | .gpio = DNS323_GPIO_LED_POWER2, |
265 | .default_trigger = "timer", | 266 | .default_trigger = "timer", |
267 | .active_low = 1, | ||
266 | }, { | 268 | }, { |
267 | .name = "right:amber", | 269 | .name = "right:amber", |
268 | .gpio = DNS323_GPIO_LED_RIGHT_AMBER, | 270 | .gpio = DNS323_GPIO_LED_RIGHT_AMBER, |