block: move down direct IO plugging
[linux/fpc-iii.git] / arch / arm / mach-omap1 / leds-innovator.c
blob3a066ee8d02c39201d0b20913944018cdf33ec83
1 /*
2 * linux/arch/arm/mach-omap1/leds-innovator.c
3 */
4 #include <linux/init.h>
6 #include <mach/hardware.h>
7 #include <asm/leds.h>
9 #include "leds.h"
12 #define LED_STATE_ENABLED 1
13 #define LED_STATE_CLAIMED 2
15 static unsigned int led_state;
16 static unsigned int hw_led_state;
18 void innovator_leds_event(led_event_t evt)
20 unsigned long flags;
22 local_irq_save(flags);
24 switch (evt) {
25 case led_start:
26 hw_led_state = 0;
27 led_state = LED_STATE_ENABLED;
28 break;
30 case led_stop:
31 led_state &= ~LED_STATE_ENABLED;
32 hw_led_state = 0;
33 break;
35 case led_claim:
36 led_state |= LED_STATE_CLAIMED;
37 hw_led_state = 0;
38 break;
40 case led_release:
41 led_state &= ~LED_STATE_CLAIMED;
42 hw_led_state = 0;
43 break;
45 #ifdef CONFIG_LEDS_TIMER
46 case led_timer:
47 if (!(led_state & LED_STATE_CLAIMED))
48 hw_led_state ^= 0;
49 break;
50 #endif
52 #ifdef CONFIG_LEDS_CPU
53 case led_idle_start:
54 if (!(led_state & LED_STATE_CLAIMED))
55 hw_led_state |= 0;
56 break;
58 case led_idle_end:
59 if (!(led_state & LED_STATE_CLAIMED))
60 hw_led_state &= ~0;
61 break;
62 #endif
64 case led_halted:
65 break;
67 case led_green_on:
68 if (led_state & LED_STATE_CLAIMED)
69 hw_led_state &= ~0;
70 break;
72 case led_green_off:
73 if (led_state & LED_STATE_CLAIMED)
74 hw_led_state |= 0;
75 break;
77 case led_amber_on:
78 break;
80 case led_amber_off:
81 break;
83 case led_red_on:
84 if (led_state & LED_STATE_CLAIMED)
85 hw_led_state &= ~0;
86 break;
88 case led_red_off:
89 if (led_state & LED_STATE_CLAIMED)
90 hw_led_state |= 0;
91 break;
93 default:
94 break;
97 local_irq_restore(flags);