Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-imx / leds-mx1ads.c
blobe6399b06e4a4742580f74f6f31289ad41c36052d
1 /*
2 * linux/arch/arm/mach-imx/leds-mx1ads.c
4 * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
6 * Original (leds-footbridge.c) by Russell King
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.
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"
24 * The MX1ADS Board has only one usable LED,
25 * so select only the timer led or the
26 * cpu usage led
28 void
29 mx1ads_leds_event(led_event_t ledevt)
31 unsigned long flags;
33 local_irq_save(flags);
35 switch (ledevt) {
36 #ifdef CONFIG_LEDS_CPU
37 case led_idle_start:
38 DR(0) &= ~(1<<2);
39 break;
41 case led_idle_end:
42 DR(0) |= 1<<2;
43 break;
44 #endif
46 #ifdef CONFIG_LEDS_TIMER
47 case led_timer:
48 DR(0) ^= 1<<2;
49 #endif
50 default:
51 break;
53 local_irq_restore(flags);