]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-arm/arch-sa1100/gpio.h
[POWERPC] ppc: Don't run prom_init_check for arch/ppc builds
[linux-2.6-omap-h63xx.git] / include / asm-arm / arch-sa1100 / gpio.h
index a331fe3f6e48b176e9edef9469b08d81a0414525..93d3395b102dcd2d6348d70fe599f4838bd63290 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/include/asm-arm/arch-pxa/gpio.h
+ * linux/include/asm-arm/arch-sa1100/gpio.h
  *
  * SA1100 GPIO wrappers for arch-neutral GPIO calls
  *
 #ifndef __ASM_ARCH_SA1100_GPIO_H
 #define __ASM_ARCH_SA1100_GPIO_H
 
-#include <asm/arch/SA-1100.h>
-#include <asm/arch/irqs.h>
-#include <asm/arch/hardware.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm-generic/gpio.h>
 
-#include <asm/errno.h>
-
-static inline int gpio_request(unsigned gpio, const char *label)
-{
-       return 0;
-}
-
-static inline void gpio_free(unsigned gpio)
+static inline int gpio_get_value(unsigned gpio)
 {
-       return;
-}
-
-static inline int gpio_direction_input(unsigned gpio)
-{
-       if (gpio > GPIO_MAX)
-               return -EINVAL;
-       GPDR = (GPDR_In << gpio) 0
+       if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
+               return GPLR & GPIO_GPIO(gpio);
+       else
+               return __gpio_get_value(gpio);
 }
 
-static inline int gpio_direction_output(unsigned gpio)
+static inline void gpio_set_value(unsigned gpio, int value)
 {
-       if (gpio > GPIO_MAX)
-               return -EINVAL;
-       GPDR = (GPDR_Out << gpio) 0
+       if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
+               if (value)
+                       GPSR = GPIO_GPIO(gpio);
+               else
+                       GPCR = GPIO_GPIO(gpio);
+       else
+               __gpio_set_value(gpio, value);
 }
 
-#define gpio_get_value(gpio) \
-       (GPLR & GPIO_GPIO(gpio))
-
-#define gpio_set_value(gpio,value) \
-       ((value) ? (GPSR = GPIO_GPIO(gpio)) : (GPCR(gpio) = GPIO_GPIO(gpio)))
-
-#include <asm-generic/gpio.h>                  /* cansleep wrappers */
+#define gpio_cansleep  __gpio_cansleep
 
 static inline unsigned gpio_to_irq(unsigned gpio)
 {