]> 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 da7575b0e5d0f2f00ca58b09cc4aeaa22635f93a..93d3395b102dcd2d6348d70fe599f4838bd63290 100644 (file)
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
-
-static inline int gpio_request(unsigned gpio, const char *label)
-{
-       return 0;
-}
-
-static inline void gpio_free(unsigned gpio)
-{
-       return;
-}
-
-extern int gpio_direction_input(unsigned gpio);
-extern int gpio_direction_output(unsigned gpio);
-
+#include <asm-generic/gpio.h>
 
 static inline int gpio_get_value(unsigned gpio)
 {
-       return GPLR & GPIO_GPIO(gpio);
+       if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
+               return GPLR & GPIO_GPIO(gpio);
+       else
+               return __gpio_get_value(gpio);
 }
 
 static inline void gpio_set_value(unsigned gpio, int value)
 {
-       if (value)
-               GPSR = GPIO_GPIO(gpio);
+       if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
+               if (value)
+                       GPSR = GPIO_GPIO(gpio);
+               else
+                       GPCR = GPIO_GPIO(gpio);
        else
-               GPCR = GPIO_GPIO(gpio);
+               __gpio_set_value(gpio, value);
 }
 
-#include <asm-generic/gpio.h>                  /* cansleep wrappers */
+#define gpio_cansleep  __gpio_cansleep
 
 static inline unsigned gpio_to_irq(unsigned gpio)
 {