x86: cpa self-test, WARN_ON()
[wrt350n-kernel.git] / arch / arm / mach-omap1 / leds-innovator.c
blobe7835d6f53a0855d82e80265a22639a62fc9b3f7
1 /*
2 * linux/arch/arm/mach-omap1/leds-innovator.c
3 */
4 #include <linux/init.h>
6 #include <asm/hardware.h>
7 #include <asm/leds.h>
8 #include <asm/system.h>
10 #include "leds.h"
13 #define LED_STATE_ENABLED 1
14 #define LED_STATE_CLAIMED 2
16 static unsigned int led_state;
17 static unsigned int hw_led_state;
19 void innovator_leds_event(led_event_t evt)
21 unsigned long flags;
23 local_irq_save(flags);
25 switch (evt) {
26 case led_start:
27 hw_led_state = 0;
28 led_state = LED_STATE_ENABLED;
29 break;
31 case led_stop:
32 led_state &= ~LED_STATE_ENABLED;
33 hw_led_state = 0;
34 break;
36 case led_claim:
37 led_state |= LED_STATE_CLAIMED;
38 hw_led_state = 0;
39 break;
41 case led_release:
42 led_state &= ~LED_STATE_CLAIMED;
43 hw_led_state = 0;
44 break;
46 #ifdef CONFIG_LEDS_TIMER
47 case led_timer:
48 if (!(led_state & LED_STATE_CLAIMED))
49 hw_led_state ^= 0;
50 break;
51 #endif
53 #ifdef CONFIG_LEDS_CPU
54 case led_idle_start:
55 if (!(led_state & LED_STATE_CLAIMED))
56 hw_led_state |= 0;
57 break;
59 case led_idle_end:
60 if (!(led_state & LED_STATE_CLAIMED))
61 hw_led_state &= ~0;
62 break;
63 #endif
65 case led_halted:
66 break;
68 case led_green_on:
69 if (led_state & LED_STATE_CLAIMED)
70 hw_led_state &= ~0;
71 break;
73 case led_green_off:
74 if (led_state & LED_STATE_CLAIMED)
75 hw_led_state |= 0;
76 break;
78 case led_amber_on:
79 break;
81 case led_amber_off:
82 break;
84 case led_red_on:
85 if (led_state & LED_STATE_CLAIMED)
86 hw_led_state &= ~0;
87 break;
89 case led_red_off:
90 if (led_state & LED_STATE_CLAIMED)
91 hw_led_state |= 0;
92 break;
94 default:
95 break;
98 local_irq_restore(flags);