]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-sa1100/generic.c
[ARM] 4870/1: fix signal return code when enable CONFIG_OABI_COMPAT
[linux-2.6-omap-h63xx.git] / arch / arm / mach-sa1100 / generic.c
index e510295c2580d89591eee0b4675f8d401f966540..5c84c604ed86d1fc5b68c89ab802d1713aa2311d 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/mach/map.h>
 #include <asm/mach/flash.h>
 #include <asm/irq.h>
+#include <asm/gpio.h>
 
 #include "generic.h"
 
@@ -138,6 +139,37 @@ unsigned long long sched_clock(void)
        return v;
 }
 
+int gpio_direction_input(unsigned gpio)
+{
+       unsigned long flags;
+
+       if (gpio > GPIO_MAX)
+               return -EINVAL;
+
+       local_irq_save(flags);
+       GPDR &= ~GPIO_GPIO(gpio);
+       local_irq_restore(flags);
+       return 0;
+}
+
+EXPORT_SYMBOL(gpio_direction_input);
+
+int gpio_direction_output(unsigned gpio, int value)
+{
+       unsigned long flags;
+
+       if (gpio > GPIO_MAX)
+               return -EINVAL;
+
+       local_irq_save(flags);
+       gpio_set_value(gpio, value);
+       GPDR |= GPIO_GPIO(gpio);
+       local_irq_restore(flags);
+       return 0;
+}
+
+EXPORT_SYMBOL(gpio_direction_output);
+
 /*
  * Default power-off for SA1100
  */
@@ -438,7 +470,7 @@ void __init sa1110_mb_disable(void)
  * If the system is going to use the SA-1111 DMA engines, set up
  * the memory bus request/grant pins.
  */
-void __init sa1110_mb_enable(void)
+void __devinit sa1110_mb_enable(void)
 {
        unsigned long flags;