diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/arm/mach-omap/leds-innovator.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/arm/mach-omap/leds-innovator.c')
-rw-r--r-- | arch/arm/mach-omap/leds-innovator.c | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/arch/arm/mach-omap/leds-innovator.c b/arch/arm/mach-omap/leds-innovator.c new file mode 100644 index 000000000000..8043b7d0f66e --- /dev/null +++ b/arch/arm/mach-omap/leds-innovator.c | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap/leds-innovator.c | ||
3 | */ | ||
4 | #include <linux/config.h> | ||
5 | #include <linux/init.h> | ||
6 | |||
7 | #include <asm/hardware.h> | ||
8 | #include <asm/leds.h> | ||
9 | #include <asm/system.h> | ||
10 | |||
11 | #include "leds.h" | ||
12 | |||
13 | |||
14 | #define LED_STATE_ENABLED 1 | ||
15 | #define LED_STATE_CLAIMED 2 | ||
16 | |||
17 | static unsigned int led_state; | ||
18 | static unsigned int hw_led_state; | ||
19 | |||
20 | void innovator_leds_event(led_event_t evt) | ||
21 | { | ||
22 | unsigned long flags; | ||
23 | |||
24 | local_irq_save(flags); | ||
25 | |||
26 | switch (evt) { | ||
27 | case led_start: | ||
28 | hw_led_state = 0; | ||
29 | led_state = LED_STATE_ENABLED; | ||
30 | break; | ||
31 | |||
32 | case led_stop: | ||
33 | led_state &= ~LED_STATE_ENABLED; | ||
34 | hw_led_state = 0; | ||
35 | break; | ||
36 | |||
37 | case led_claim: | ||
38 | led_state |= LED_STATE_CLAIMED; | ||
39 | hw_led_state = 0; | ||
40 | break; | ||
41 | |||
42 | case led_release: | ||
43 | led_state &= ~LED_STATE_CLAIMED; | ||
44 | hw_led_state = 0; | ||
45 | break; | ||
46 | |||
47 | #ifdef CONFIG_LEDS_TIMER | ||
48 | case led_timer: | ||
49 | if (!(led_state & LED_STATE_CLAIMED)) | ||
50 | hw_led_state ^= 0; | ||
51 | break; | ||
52 | #endif | ||
53 | |||
54 | #ifdef CONFIG_LEDS_CPU | ||
55 | case led_idle_start: | ||
56 | if (!(led_state & LED_STATE_CLAIMED)) | ||
57 | hw_led_state |= 0; | ||
58 | break; | ||
59 | |||
60 | case led_idle_end: | ||
61 | if (!(led_state & LED_STATE_CLAIMED)) | ||
62 | hw_led_state &= ~0; | ||
63 | break; | ||
64 | #endif | ||
65 | |||
66 | case led_halted: | ||
67 | break; | ||
68 | |||
69 | case led_green_on: | ||
70 | if (led_state & LED_STATE_CLAIMED) | ||
71 | hw_led_state &= ~0; | ||
72 | break; | ||
73 | |||
74 | case led_green_off: | ||
75 | if (led_state & LED_STATE_CLAIMED) | ||
76 | hw_led_state |= 0; | ||
77 | break; | ||
78 | |||
79 | case led_amber_on: | ||
80 | break; | ||
81 | |||
82 | case led_amber_off: | ||
83 | break; | ||
84 | |||
85 | case led_red_on: | ||
86 | if (led_state & LED_STATE_CLAIMED) | ||
87 | hw_led_state &= ~0; | ||
88 | break; | ||
89 | |||
90 | case led_red_off: | ||
91 | if (led_state & LED_STATE_CLAIMED) | ||
92 | hw_led_state |= 0; | ||
93 | break; | ||
94 | |||
95 | default: | ||
96 | break; | ||
97 | } | ||
98 | |||
99 | if (led_state & LED_STATE_ENABLED) | ||
100 | ; | ||
101 | |||
102 | local_irq_restore(flags); | ||
103 | } | ||