aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-sa1100/gpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/arch-sa1100/gpio.h')
-rw-r--r--include/asm-arm/arch-sa1100/gpio.h31
1 files changed, 12 insertions, 19 deletions
diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h
index e7a9d26e22a8..93d3395b102d 100644
--- a/include/asm-arm/arch-sa1100/gpio.h
+++ b/include/asm-arm/arch-sa1100/gpio.h
@@ -26,35 +26,28 @@
26 26
27#include <asm/hardware.h> 27#include <asm/hardware.h>
28#include <asm/irq.h> 28#include <asm/irq.h>
29 29#include <asm-generic/gpio.h>
30static inline int gpio_request(unsigned gpio, const char *label)
31{
32 return 0;
33}
34
35static inline void gpio_free(unsigned gpio)
36{
37 return;
38}
39
40extern int gpio_direction_input(unsigned gpio);
41extern int gpio_direction_output(unsigned gpio, int value);
42
43 30
44static inline int gpio_get_value(unsigned gpio) 31static inline int gpio_get_value(unsigned gpio)
45{ 32{
46 return GPLR & GPIO_GPIO(gpio); 33 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
34 return GPLR & GPIO_GPIO(gpio);
35 else
36 return __gpio_get_value(gpio);
47} 37}
48 38
49static inline void gpio_set_value(unsigned gpio, int value) 39static inline void gpio_set_value(unsigned gpio, int value)
50{ 40{
51 if (value) 41 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
52 GPSR = GPIO_GPIO(gpio); 42 if (value)
43 GPSR = GPIO_GPIO(gpio);
44 else
45 GPCR = GPIO_GPIO(gpio);
53 else 46 else
54 GPCR = GPIO_GPIO(gpio); 47 __gpio_set_value(gpio, value);
55} 48}
56 49
57#include <asm-generic/gpio.h> /* cansleep wrappers */ 50#define gpio_cansleep __gpio_cansleep
58 51
59static inline unsigned gpio_to_irq(unsigned gpio) 52static inline unsigned gpio_to_irq(unsigned gpio)
60{ 53{