Merge branch 'master' into for-linus
[safe/jmp/linux-2.6] / drivers / pcmcia / sa1100_h3600.c
index 64fd5e3..0cc3748 100644 (file)
@@ -6,16 +6,15 @@
  */
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 
-#include <asm/hardware.h>
+#include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
-#include <asm/arch/h3600.h>
+#include <mach/h3600.h>
 
 #include "sa1100_generic.h"
 
@@ -38,9 +37,9 @@ static void h3600_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
        soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
   
        /* Disable CF bus: */
-       clr_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON);
-       clr_h3600_egpio(IPAQ_EGPIO_OPT_ON);
-       set_h3600_egpio(IPAQ_EGPIO_OPT_RESET);
+       assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 0);
+       assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 0);
+       assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 1);
 }
 
 static void
@@ -80,10 +79,7 @@ h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_
                return -1;
        }
 
-       if (state->flags & SS_RESET)
-               set_h3600_egpio(IPAQ_EGPIO_CARD_RESET);
-       else
-               clr_h3600_egpio(IPAQ_EGPIO_CARD_RESET);
+       assign_h3600_egpio(IPAQ_EGPIO_CARD_RESET, !!(state->flags & SS_RESET));
 
        /* Silently ignore Vpp, output enable, speaker enable. */
 
@@ -93,9 +89,9 @@ h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_
 static void h3600_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
        /* Enable CF bus: */
-       set_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON);
-       set_h3600_egpio(IPAQ_EGPIO_OPT_ON);
-       clr_h3600_egpio(IPAQ_EGPIO_OPT_RESET);
+       assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 1);
+       assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 1);
+       assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 0);
 
        msleep(10);
 
@@ -113,10 +109,10 @@ static void h3600_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
         * socket 0 then socket 1.
         */
        if (skt->nr == 1) {
-               clr_h3600_egpio(IPAQ_EGPIO_OPT_ON);
-               clr_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON);
+               assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 0);
+               assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 0);
                /* hmm, does this suck power? */
-               set_h3600_egpio(IPAQ_EGPIO_OPT_RESET);
+               assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 1);
        }
 }