Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[pandora-kernel.git] / arch / arm / plat-pxa / include / plat / gpio.h
1 #ifndef __PLAT_GPIO_H
2 #define __PLAT_GPIO_H
3
4 #define __ARM_GPIOLIB_COMPLEX
5
6 /* The individual machine provides register offsets and NR_BUILTIN_GPIO */
7 #include <mach/gpio-pxa.h>
8
9 static inline int gpio_get_value(unsigned gpio)
10 {
11         if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO))
12                 return GPLR(gpio) & GPIO_bit(gpio);
13         else
14                 return __gpio_get_value(gpio);
15 }
16
17 static inline void gpio_set_value(unsigned gpio, int value)
18 {
19         if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) {
20                 if (value)
21                         GPSR(gpio) = GPIO_bit(gpio);
22                 else
23                         GPCR(gpio) = GPIO_bit(gpio);
24         } else
25                 __gpio_set_value(gpio, value);
26 }
27
28 #define gpio_cansleep           __gpio_cansleep
29
30 #endif /* __PLAT_GPIO_H */