Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind...
[safe/jmp/linux-2.6] / arch / mips / cobalt / reset.c
index 81628b3..516b442 100644 (file)
  */
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/jiffies.h>
 #include <linux/leds.h>
 
+#include <asm/processor.h>
+
 #include <cobalt.h>
 
 #define RESET_PORT     ((void __iomem *)CKSEG1ADDR(0x1c000000))
@@ -29,28 +30,15 @@ device_initcall(ledtrig_power_off_init);
 
 void cobalt_machine_halt(void)
 {
-       int state, last, diff;
-       unsigned long mark;
-
        /*
         * turn on power off LED on RaQ
-        *
-        * restart if ENTER and SELECT are pressed
         */
-
-       last = COBALT_KEY_PORT;
-
        led_trigger_event(power_off_led_trigger, LED_FULL);
 
-       for (state = 0;;) {
-               diff = COBALT_KEY_PORT ^ last;
-               last ^= diff;
-
-               if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)))
-                       writeb(RESET, RESET_PORT);
-
-               for (mark = jiffies; jiffies - mark < HZ;)
-                       ;
+       local_irq_disable();
+       while (1) {
+               if (cpu_wait)
+                       cpu_wait();
        }
 }
 
@@ -61,12 +49,3 @@ void cobalt_machine_restart(char *command)
        /* we should never get here */
        cobalt_machine_halt();
 }
-
-/*
- * This triggers the luser mode device driver for the power switch ;-)
- */
-void cobalt_machine_power_off(void)
-{
-       printk("You can switch the machine off now.\n");
-       cobalt_machine_halt();
-}