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)
34 hw_led_state = LED_GREEN;
35 led_state = LED_STATE_ENABLED;
39 led_state &= ~LED_STATE_ENABLED;
43 led_state |= LED_STATE_CLAIMED;
44 hw_led_state = LED_GREEN;
48 led_state &= ~LED_STATE_CLAIMED;
49 hw_led_state = LED_GREEN;
52 #ifdef CONFIG_LEDS_TIMER
54 if (!(led_state & LED_STATE_CLAIMED))
55 hw_led_state ^= LED_GREEN;
59 #ifdef CONFIG_LEDS_CPU
71 if (led_state & LED_STATE_CLAIMED)
72 hw_led_state |= LED_GREEN;
76 if (led_state & LED_STATE_CLAIMED)
77 hw_led_state &= ~LED_GREEN;
96 if (led_state & LED_STATE_ENABLED)
99 clear_cs3_bit(LED2_ON);