2 * linux/arch/arm/mach-pxa/leds-lubbock.c
4 * Copyright (C) 2000 John Dorsey <john+@cs.cmu.edu>
6 * Copyright (c) 2001 Jeff Sutherland <jeffs@accelent.com>
8 * Original (leds-footbridge.c) by Russell King
10 * Major surgery on April 2004 by Nicolas Pitre for less global
11 * namespace collision. Mostly adapted the Mainstone version.
14 #include <linux/config.h>
15 #include <linux/init.h>
17 #include <asm/hardware.h>
19 #include <asm/system.h>
20 #include <asm/arch/pxa-regs.h>
21 #include <asm/arch/lubbock.h>
26 * 8 discrete leds available for general use:
28 * Note: bits [15-8] are used to enable/blank the 8 7 segment hex displays
29 * so be sure to not monkey with them here.
41 #define LED_STATE_ENABLED 1
42 #define LED_STATE_CLAIMED 2
44 static unsigned int led_state
;
45 static unsigned int hw_led_state
;
47 void lubbock_leds_event(led_event_t evt
)
51 local_irq_save(flags
);
56 led_state
= LED_STATE_ENABLED
;
60 led_state
&= ~LED_STATE_ENABLED
;
64 led_state
|= LED_STATE_CLAIMED
;
69 led_state
&= ~LED_STATE_CLAIMED
;
73 #ifdef CONFIG_LEDS_TIMER
79 #ifdef CONFIG_LEDS_CPU
105 hw_led_state
&= ~D22
;
113 hw_led_state
&= ~D23
;
120 if (led_state
& LED_STATE_ENABLED
)
121 LUB_DISC_BLNK_LED
= (LUB_DISC_BLNK_LED
| 0xff) & ~hw_led_state
;
123 LUB_DISC_BLNK_LED
|= 0xff;
125 local_irq_restore(flags
);