2 * linux/arch/arm/mach-sa1100/leds-simpad.c
4 * Author: Juergen Messerer <juergen.messerer@siemens.ch>
6 #include <linux/config.h>
7 #include <linux/init.h>
9 #include <asm/hardware.h>
11 #include <asm/system.h>
12 #include <asm/arch/simpad.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
;
26 extern void set_cs3_bit(int value
);
27 extern void clear_cs3_bit(int value
);
29 void simpad_leds_event(led_event_t evt
)
33 //local_irq_save(flags);
38 hw_led_state
= LED_GREEN
;
39 led_state
= LED_STATE_ENABLED
;
43 led_state
&= ~LED_STATE_ENABLED
;
47 led_state
|= LED_STATE_CLAIMED
;
48 hw_led_state
= LED_GREEN
;
52 led_state
&= ~LED_STATE_CLAIMED
;
53 hw_led_state
= LED_GREEN
;
56 #ifdef CONFIG_LEDS_TIMER
58 if (!(led_state
& LED_STATE_CLAIMED
))
59 hw_led_state
^= LED_GREEN
;
63 #ifdef CONFIG_LEDS_CPU
75 if (led_state
& LED_STATE_CLAIMED
)
76 hw_led_state
|= LED_GREEN
;
80 if (led_state
& LED_STATE_CLAIMED
)
81 hw_led_state
&= ~LED_GREEN
;
100 if (led_state
& LED_STATE_ENABLED
)
101 set_cs3_bit(LED2_ON
);
103 clear_cs3_bit(LED2_ON
);
104 //local_irq_restore(flags);