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/init.h>
16 #include <mach/hardware.h>
18 #include <asm/system.h>
19 #include <mach/pxa25x.h>
20 #include <mach/lubbock.h>
25 * 8 discrete leds available for general use:
27 * Note: bits [15-8] are used to enable/blank the 8 7 segment hex displays
28 * so be sure to not monkey with them here.
40 #define LED_STATE_ENABLED 1
41 #define LED_STATE_CLAIMED 2
43 static unsigned int led_state
;
44 static unsigned int hw_led_state
;
46 void lubbock_leds_event(led_event_t evt
)
50 local_irq_save(flags
);
55 led_state
= LED_STATE_ENABLED
;
59 led_state
&= ~LED_STATE_ENABLED
;
63 led_state
|= LED_STATE_CLAIMED
;
68 led_state
&= ~LED_STATE_CLAIMED
;
72 #ifdef CONFIG_LEDS_TIMER
78 #ifdef CONFIG_LEDS_CPU
104 hw_led_state
&= ~D22
;
112 hw_led_state
&= ~D23
;
119 if (led_state
& LED_STATE_ENABLED
)
120 LUB_DISC_BLNK_LED
= (LUB_DISC_BLNK_LED
| 0xff) & ~hw_led_state
;
122 LUB_DISC_BLNK_LED
|= 0xff;
124 local_irq_restore(flags
);