Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[pandora-kernel.git] / arch / arm / mach-sa1100 / generic.c
index e510295..192a5a2 100644 (file)
@@ -138,6 +138,36 @@ 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)
+{
+       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_output);
+
 /*
  * Default power-off for SA1100
  */