2 * linux/arch/arm/mach-sa1100/leds-adsbitsy.c
7 #include <linux/config.h>
8 #include <linux/init.h>
10 #include <asm/hardware.h>
12 #include <asm/system.h>
17 #define LED_STATE_ENABLED 1
18 #define LED_STATE_CLAIMED 2
20 static unsigned int led_state
;
21 static unsigned int hw_led_state
;
23 #define LED_TIMER GPIO_GPIO20 /* green heartbeat */
25 #define LED_MASK (LED_TIMER)
27 void adsbitsy_leds_event(led_event_t evt
)
31 local_irq_save(flags
);
35 hw_led_state
= 0; /* gc leds are positive logic */
36 led_state
= LED_STATE_ENABLED
;
40 led_state
&= ~LED_STATE_ENABLED
;
44 led_state
|= LED_STATE_CLAIMED
;
45 hw_led_state
= LED_MASK
;
49 led_state
&= ~LED_STATE_CLAIMED
;
50 hw_led_state
= LED_MASK
;
53 #ifdef CONFIG_LEDS_TIMER
55 if (!(led_state
& LED_STATE_CLAIMED
))
56 hw_led_state
^= LED_TIMER
;
60 #ifdef CONFIG_LEDS_CPU
90 if (led_state
& LED_STATE_ENABLED
) {
92 GPCR
= hw_led_state
^ LED_MASK
;
95 local_irq_restore(flags
);