2 * linux/arch/arm/mach-pxa/leds-mainstone.c
4 * Author: Nicolas Pitre
5 * Created: Nov 05, 2002
6 * Copyright: MontaVista Software Inc.
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.
13 #include <linux/config.h>
14 #include <linux/init.h>
16 #include <asm/hardware.h>
18 #include <asm/system.h>
20 #include <asm/arch/pxa-regs.h>
21 #include <asm/arch/mainstone.h>
26 /* 8 discrete leds available for general use: */
36 #define LED_STATE_ENABLED 1
37 #define LED_STATE_CLAIMED 2
39 static unsigned int led_state
;
40 static unsigned int hw_led_state
;
42 void mainstone_leds_event(led_event_t evt
)
46 local_irq_save(flags
);
51 led_state
= LED_STATE_ENABLED
;
55 led_state
&= ~LED_STATE_ENABLED
;
59 led_state
|= LED_STATE_CLAIMED
;
64 led_state
&= ~LED_STATE_CLAIMED
;
68 #ifdef CONFIG_LEDS_TIMER
74 #ifdef CONFIG_LEDS_CPU
100 hw_led_state
&= ~D22
;
104 hw_led_state
|= D23
;;
108 hw_led_state
&= ~D23
;
115 if (led_state
& LED_STATE_ENABLED
)
116 MST_LEDCTRL
= (MST_LEDCTRL
| 0xff) & ~hw_led_state
;
120 local_irq_restore(flags
);