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/init.h>
15 #include <mach/hardware.h>
17 #include <asm/system.h>
19 #include <mach/pxa27x.h>
20 #include <mach/mainstone.h>
25 /* 8 discrete leds available for general use: */
35 #define LED_STATE_ENABLED 1
36 #define LED_STATE_CLAIMED 2
38 static unsigned int led_state
;
39 static unsigned int hw_led_state
;
41 void mainstone_leds_event(led_event_t evt
)
45 local_irq_save(flags
);
50 led_state
= LED_STATE_ENABLED
;
54 led_state
&= ~LED_STATE_ENABLED
;
58 led_state
|= LED_STATE_CLAIMED
;
63 led_state
&= ~LED_STATE_CLAIMED
;
67 #ifdef CONFIG_LEDS_TIMER
73 #ifdef CONFIG_LEDS_CPU
107 hw_led_state
&= ~D23
;
114 if (led_state
& LED_STATE_ENABLED
)
115 MST_LEDCTRL
= (MST_LEDCTRL
| 0xff) & ~hw_led_state
;
119 local_irq_restore(flags
);