2 * linux/arch/arm/mach-omaha/leds.c
4 * Omaha LED control routines
6 * Copyright (C) 1999-2002 ARM Limited
7 * Copyright (C) 2000 Deep Blue Solutions Ltd
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include <linux/kernel.h>
24 #include <linux/init.h>
26 #include <asm/hardware.h>
29 #include <asm/system.h>
30 #include <asm/mach-types.h>
32 static int saved_leds;
34 static void omaha_leds_event(led_event_t ledevt)
37 unsigned int ctrl = IO_ADDRESS(PLAT_DBG_LEDS);
40 // yup, change the LEDs
41 local_irq_save(flags);
45 leds = __raw_readl(ctrl);
47 __raw_writel(leds,ctrl);
51 leds = __raw_readl(ctrl);
53 __raw_writel(leds,ctrl);
57 leds = __raw_readl(ctrl);
59 __raw_writel(leds,ctrl);
63 leds = __raw_readl(ctrl);
65 __raw_writel(leds,ctrl);
69 leds = __raw_readl(ctrl);
71 __raw_writel(leds,ctrl);
78 local_irq_restore(flags);
81 static int __init leds_init(void)
83 if (machine_is_omaha())
84 leds_event = omaha_leds_event;
89 __initcall(leds_init);