2 * linux/arch/arm/mach-sa1100/leds-simpad.c
4 * Author: Juergen Messerer <juergen.messerer@siemens.ch>
6 #include <linux/init.h>
8 #include <mach/hardware.h>
10 #include <asm/system.h>
11 #include <mach/simpad.h>
16 #define LED_STATE_ENABLED 1
17 #define LED_STATE_CLAIMED 2
19 static unsigned int led_state
;
20 static unsigned int hw_led_state
;
25 extern void set_cs3_bit(int value
);
26 extern void clear_cs3_bit(int value
);
28 void simpad_leds_event(led_event_t evt
)
33 hw_led_state
= LED_GREEN
;
34 led_state
= LED_STATE_ENABLED
;
38 led_state
&= ~LED_STATE_ENABLED
;
42 led_state
|= LED_STATE_CLAIMED
;
43 hw_led_state
= LED_GREEN
;
47 led_state
&= ~LED_STATE_CLAIMED
;
48 hw_led_state
= LED_GREEN
;
51 #ifdef CONFIG_LEDS_TIMER
53 if (!(led_state
& LED_STATE_CLAIMED
))
54 hw_led_state
^= LED_GREEN
;
58 #ifdef CONFIG_LEDS_CPU
70 if (led_state
& LED_STATE_CLAIMED
)
71 hw_led_state
|= LED_GREEN
;
75 if (led_state
& LED_STATE_CLAIMED
)
76 hw_led_state
&= ~LED_GREEN
;
95 if (led_state
& LED_STATE_ENABLED
)
98 clear_cs3_bit(LED2_ON
);