]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: P2 timer/idle LEDs fix
authorTodd Poynor <tpoynor@mvista.com>
Tue, 11 Oct 2005 15:21:11 +0000 (18:21 +0300)
committerTony Lindgren <tony@atomide.com>
Tue, 11 Oct 2005 15:21:11 +0000 (18:21 +0300)
Must... have.. blinky... LEDs... on OMAP730 P2...

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/leds-h2p2-debug.c
include/asm-arm/arch-omap/fpga.h

index be283cda63dda9f5817c0e9befce16d7e135974c..38c66bdc2260e132b6d2094c037ebdb9c64144f1 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/hardware.h>
 #include <asm/leds.h>
 #include <asm/system.h>
+#include <asm/mach-types.h>
 
 #include <asm/arch/fpga.h>
 #include <asm/arch/gpio.h>
@@ -64,14 +65,19 @@ void h2p2_dbg_leds_event(led_event_t evt)
        case led_stop:
        case led_halted:
                /* all leds off during suspend or shutdown */
-               omap_set_gpio_dataout(GPIO_TIMER, 0);
-               omap_set_gpio_dataout(GPIO_IDLE, 0);
+
+               if (! machine_is_omap_perseus2()) {
+                       omap_set_gpio_dataout(GPIO_TIMER, 0);
+                       omap_set_gpio_dataout(GPIO_IDLE, 0);
+               }
+
                __raw_writew(~0, &fpga->leds);
                led_state &= ~LED_STATE_ENABLED;
                if (evt == led_halted) {
                        iounmap(fpga);
                        fpga = NULL;
                }
+
                goto done;
 
        case led_claim:
@@ -86,18 +92,37 @@ void h2p2_dbg_leds_event(led_event_t evt)
 #ifdef CONFIG_LEDS_TIMER
        case led_timer:
                led_state ^= LED_TIMER_ON;
-               omap_set_gpio_dataout(GPIO_TIMER, led_state & LED_TIMER_ON);
-               goto done;
+
+               if (machine_is_omap_perseus2())
+                       hw_led_state ^= H2P2_DBG_FPGA_P2_LED_TIMER;
+               else {
+                       omap_set_gpio_dataout(GPIO_TIMER, led_state & LED_TIMER_ON);
+                       goto done;
+               }
+
+               break;
 #endif
 
 #ifdef CONFIG_LEDS_CPU
        case led_idle_start:
-               omap_set_gpio_dataout(GPIO_IDLE, 1);
-               goto done;
+               if (machine_is_omap_perseus2())
+                       hw_led_state |= H2P2_DBG_FPGA_P2_LED_IDLE;
+               else {
+                       omap_set_gpio_dataout(GPIO_IDLE, 1);
+                       goto done;
+               }
+
+               break;
 
        case led_idle_end:
-               omap_set_gpio_dataout(GPIO_IDLE, 0);
-               goto done;
+               if (machine_is_omap_perseus2())
+                       hw_led_state &= ~H2P2_DBG_FPGA_P2_LED_IDLE;
+               else {
+                       omap_set_gpio_dataout(GPIO_IDLE, 0);
+                       goto done;
+               }
+
+               break;
 #endif
 
        case led_green_on:
@@ -136,7 +161,7 @@ void h2p2_dbg_leds_event(led_event_t evt)
        /*
         *  Actually burn the LEDs
         */
-       if (led_state & LED_STATE_CLAIMED)
+       if (led_state & LED_STATE_ENABLED)
                __raw_writew(~hw_led_state, &fpga->leds);
 
 done:
index d718c96092780b10613787044d9550b6c6a88e24..6a883e0bdbb803cf9f5a6b60ab5a1e5906623ca7 100644 (file)
@@ -77,6 +77,8 @@ struct h2p2_dbg_fpga {
 #define H2P2_DBG_FPGA_LOAD_METER_SIZE  11
 #define H2P2_DBG_FPGA_LOAD_METER_MASK  ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
 
+#define H2P2_DBG_FPGA_P2_LED_TIMER             (1 << 0)
+#define H2P2_DBG_FPGA_P2_LED_IDLE              (1 << 1)
 
 /*
  * ---------------------------------------------------------------------------