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-sa1100/leds-simpad.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-sa1100/leds-simpad.c')
-rw-r--r-- | arch/arm/mach-sa1100/leds-simpad.c | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/arch/arm/mach-sa1100/leds-simpad.c b/arch/arm/mach-sa1100/leds-simpad.c new file mode 100644 index 000000000000..6a27a2d32206 --- /dev/null +++ b/arch/arm/mach-sa1100/leds-simpad.c | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-sa1100/leds-simpad.c | ||
3 | * | ||
4 | * Author: Juergen Messerer <juergen.messerer@siemens.ch> | ||
5 | */ | ||
6 | #include <linux/config.h> | ||
7 | #include <linux/init.h> | ||
8 | |||
9 | #include <asm/hardware.h> | ||
10 | #include <asm/leds.h> | ||
11 | #include <asm/system.h> | ||
12 | #include <asm/arch/simpad.h> | ||
13 | |||
14 | #include "leds.h" | ||
15 | |||
16 | |||
17 | #define LED_STATE_ENABLED 1 | ||
18 | #define LED_STATE_CLAIMED 2 | ||
19 | |||
20 | static unsigned int led_state; | ||
21 | static unsigned int hw_led_state; | ||
22 | |||
23 | #define LED_GREEN (1) | ||
24 | #define LED_MASK (1) | ||
25 | |||
26 | extern void set_cs3_bit(int value); | ||
27 | extern void clear_cs3_bit(int value); | ||
28 | |||
29 | void simpad_leds_event(led_event_t evt) | ||
30 | { | ||
31 | switch (evt) | ||
32 | { | ||
33 | case led_start: | ||
34 | hw_led_state = LED_GREEN; | ||
35 | led_state = LED_STATE_ENABLED; | ||
36 | break; | ||
37 | |||
38 | case led_stop: | ||
39 | led_state &= ~LED_STATE_ENABLED; | ||
40 | break; | ||
41 | |||
42 | case led_claim: | ||
43 | led_state |= LED_STATE_CLAIMED; | ||
44 | hw_led_state = LED_GREEN; | ||
45 | break; | ||
46 | |||
47 | case led_release: | ||
48 | led_state &= ~LED_STATE_CLAIMED; | ||
49 | hw_led_state = LED_GREEN; | ||
50 | break; | ||
51 | |||
52 | #ifdef CONFIG_LEDS_TIMER | ||
53 | case led_timer: | ||
54 | if (!(led_state & LED_STATE_CLAIMED)) | ||
55 | hw_led_state ^= LED_GREEN; | ||
56 | break; | ||
57 | #endif | ||
58 | |||
59 | #ifdef CONFIG_LEDS_CPU | ||
60 | case led_idle_start: | ||
61 | break; | ||
62 | |||
63 | case led_idle_end: | ||
64 | break; | ||
65 | #endif | ||
66 | |||
67 | case led_halted: | ||
68 | break; | ||
69 | |||
70 | case led_green_on: | ||
71 | if (led_state & LED_STATE_CLAIMED) | ||
72 | hw_led_state |= LED_GREEN; | ||
73 | break; | ||
74 | |||
75 | case led_green_off: | ||
76 | if (led_state & LED_STATE_CLAIMED) | ||
77 | hw_led_state &= ~LED_GREEN; | ||
78 | break; | ||
79 | |||
80 | case led_amber_on: | ||
81 | break; | ||
82 | |||
83 | case led_amber_off: | ||
84 | break; | ||
85 | |||
86 | case led_red_on: | ||
87 | break; | ||
88 | |||
89 | case led_red_off: | ||
90 | break; | ||
91 | |||
92 | default: | ||
93 | break; | ||
94 | } | ||
95 | |||
96 | if (led_state & LED_STATE_ENABLED) | ||
97 | set_cs3_bit(LED2_ON); | ||
98 | else | ||
99 | clear_cs3_bit(LED2_ON); | ||
100 | } | ||
101 | |||