static inline void at91_led_toggle(unsigned int led) { unsigned long is_off = at91_get_gpio_value(led); if (is_off) at91_led_on(led); else at91_led_off(led); }
static void at91_leds_event(led_event_t evt) { unsigned long flags; local_irq_save(flags); switch(evt) { case led_start: at91_led_on(at91_leds_cpu); break; case led_stop: at91_led_off(at91_leds_cpu); break; #ifdef CONFIG_LEDS_TIMER case led_timer: at91_led_toggle(at91_leds_timer); break; #endif #ifdef CONFIG_LEDS_CPU case led_idle_start: at91_led_off(at91_leds_cpu); break; case led_idle_end: at91_led_on(at91_leds_cpu); break; #endif default: break; } local_irq_restore(flags); }
/* * Handle LED events. */ static void at91_leds_event(led_event_t evt) { unsigned long flags; local_irq_save(flags); switch(evt) { case led_start: /* System startup */ at91_led_on(at91_leds_cpu); break; case led_stop: /* System stop / suspend */ at91_led_off(at91_leds_cpu); break; #ifdef CONFIG_LEDS_TIMER case led_timer: /* Every 50 timer ticks */ at91_led_toggle(at91_leds_timer); break; #endif #ifdef CONFIG_LEDS_CPU case led_idle_start: /* Entering idle state */ at91_led_off(at91_leds_cpu); break; case led_idle_end: /* Exit idle state */ at91_led_on(at91_leds_cpu); break; #endif default: break; } local_irq_restore(flags); }