aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/leds-h2p2-debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/leds-h2p2-debug.c')
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c44
1 files changed, 34 insertions, 10 deletions
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index be283cda63dd..650650815915 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -13,12 +13,12 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/version.h>
17 16
18#include <asm/io.h> 17#include <asm/io.h>
19#include <asm/hardware.h> 18#include <asm/hardware.h>
20#include <asm/leds.h> 19#include <asm/leds.h>
21#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/mach-types.h>
22 22
23#include <asm/arch/fpga.h> 23#include <asm/arch/fpga.h>
24#include <asm/arch/gpio.h> 24#include <asm/arch/gpio.h>
@@ -64,14 +64,19 @@ void h2p2_dbg_leds_event(led_event_t evt)
64 case led_stop: 64 case led_stop:
65 case led_halted: 65 case led_halted:
66 /* all leds off during suspend or shutdown */ 66 /* all leds off during suspend or shutdown */
67 omap_set_gpio_dataout(GPIO_TIMER, 0); 67
68 omap_set_gpio_dataout(GPIO_IDLE, 0); 68 if (! machine_is_omap_perseus2()) {
69 omap_set_gpio_dataout(GPIO_TIMER, 0);
70 omap_set_gpio_dataout(GPIO_IDLE, 0);
71 }
72
69 __raw_writew(~0, &fpga->leds); 73 __raw_writew(~0, &fpga->leds);
70 led_state &= ~LED_STATE_ENABLED; 74 led_state &= ~LED_STATE_ENABLED;
71 if (evt == led_halted) { 75 if (evt == led_halted) {
72 iounmap(fpga); 76 iounmap(fpga);
73 fpga = NULL; 77 fpga = NULL;
74 } 78 }
79
75 goto done; 80 goto done;
76 81
77 case led_claim: 82 case led_claim:
@@ -86,18 +91,37 @@ void h2p2_dbg_leds_event(led_event_t evt)
86#ifdef CONFIG_LEDS_TIMER 91#ifdef CONFIG_LEDS_TIMER
87 case led_timer: 92 case led_timer:
88 led_state ^= LED_TIMER_ON; 93 led_state ^= LED_TIMER_ON;
89 omap_set_gpio_dataout(GPIO_TIMER, led_state & LED_TIMER_ON); 94
90 goto done; 95 if (machine_is_omap_perseus2())
96 hw_led_state ^= H2P2_DBG_FPGA_P2_LED_TIMER;
97 else {
98 omap_set_gpio_dataout(GPIO_TIMER, led_state & LED_TIMER_ON);
99 goto done;
100 }
101
102 break;
91#endif 103#endif
92 104
93#ifdef CONFIG_LEDS_CPU 105#ifdef CONFIG_LEDS_CPU
94 case led_idle_start: 106 case led_idle_start:
95 omap_set_gpio_dataout(GPIO_IDLE, 1); 107 if (machine_is_omap_perseus2())
96 goto done; 108 hw_led_state |= H2P2_DBG_FPGA_P2_LED_IDLE;
109 else {
110 omap_set_gpio_dataout(GPIO_IDLE, 1);
111 goto done;
112 }
113
114 break;
97 115
98 case led_idle_end: 116 case led_idle_end:
99 omap_set_gpio_dataout(GPIO_IDLE, 0); 117 if (machine_is_omap_perseus2())
100 goto done; 118 hw_led_state &= ~H2P2_DBG_FPGA_P2_LED_IDLE;
119 else {
120 omap_set_gpio_dataout(GPIO_IDLE, 0);
121 goto done;
122 }
123
124 break;
101#endif 125#endif
102 126
103 case led_green_on: 127 case led_green_on:
@@ -136,7 +160,7 @@ void h2p2_dbg_leds_event(led_event_t evt)
136 /* 160 /*
137 * Actually burn the LEDs 161 * Actually burn the LEDs
138 */ 162 */
139 if (led_state & LED_STATE_CLAIMED) 163 if (led_state & LED_STATE_ENABLED)
140 __raw_writew(~hw_led_state, &fpga->leds); 164 __raw_writew(~hw_led_state, &fpga->leds);
141 165
142done: 166done: