aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100/generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-sa1100/generic.c')
-rw-r--r--arch/arm/mach-sa1100/generic.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index e510295c2580..9e13c8358ea7 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -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
*/