2 * linux/arch/arm/mach-omap/leds-h2p2-debug.c
4 * Copyright 2003 by Texas Instruments Incorporated
7 #include <linux/config.h>
8 #include <linux/init.h>
9 #include <linux/kernel_stat.h>
10 #include <linux/sched.h>
11 #include <linux/version.h>
14 #include <asm/hardware.h>
16 #include <asm/system.h>
18 #include <asm/arch/fpga.h>
22 void h2p2_dbg_leds_event(led_event_t evt
)
25 static unsigned long hw_led_state
= 0;
27 local_irq_save(flags
);
31 hw_led_state
|= H2P2_DBG_FPGA_LED_STARTSTOP
;
35 hw_led_state
&= ~H2P2_DBG_FPGA_LED_STARTSTOP
;
39 hw_led_state
|= H2P2_DBG_FPGA_LED_CLAIMRELEASE
;
43 hw_led_state
&= ~H2P2_DBG_FPGA_LED_CLAIMRELEASE
;
46 #ifdef CONFIG_LEDS_TIMER
51 if (hw_led_state
& H2P2_DBG_FPGA_LED_TIMER
)
52 hw_led_state
&= ~H2P2_DBG_FPGA_LED_TIMER
;
54 hw_led_state
|= H2P2_DBG_FPGA_LED_TIMER
;
58 #ifdef CONFIG_LEDS_CPU
60 hw_led_state
|= H2P2_DBG_FPGA_LED_IDLE
;
64 hw_led_state
&= ~H2P2_DBG_FPGA_LED_IDLE
;
69 if (hw_led_state
& H2P2_DBG_FPGA_LED_HALTED
)
70 hw_led_state
&= ~H2P2_DBG_FPGA_LED_HALTED
;
72 hw_led_state
|= H2P2_DBG_FPGA_LED_HALTED
;
99 * Actually burn the LEDs
101 __raw_writew(~hw_led_state
& 0xffff, H2P2_DBG_FPGA_LEDS
);
103 local_irq_restore(flags
);