Linux-2.6.12-rc2
[pandora-kernel.git] / arch / arm / mach-imx / leds-mx1ads.c
1 /*
2  * linux/arch/arm/mach-imx/leds-mx1ads.c
3  *
4  * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
5  *
6  * Original (leds-footbridge.c) by Russell King
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  */
13
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <asm/hardware.h>
17 #include <asm/system.h>
18 #include <asm/io.h>
19 #include <asm/leds.h>
20 #include <asm/mach-types.h>
21 #include "leds.h"
22
23 /*
24  * The MX1ADS Board has only one usable LED,
25  * so select only the timer led or the
26  * cpu usage led
27  */
28 void
29 mx1ads_leds_event(led_event_t ledevt)
30 {
31         unsigned long flags;
32
33         local_irq_save(flags);
34
35         switch (ledevt) {
36 #ifdef CONFIG_LEDS_CPU
37         case led_idle_start:
38                 DR(0) &= ~(1<<2);
39                 break;
40
41         case led_idle_end:
42                 DR(0) |= 1<<2;
43                 break;
44 #endif
45
46 #ifdef CONFIG_LEDS_TIMER
47         case led_timer:
48                 DR(0) ^= 1<<2;
49 #endif
50         default:
51                 break;
52         }
53         local_irq_restore(flags);
54 }