diff options
Diffstat (limited to 'arch/arm/plat-omap/include/mach/gpio.h')
-rw-r--r-- | arch/arm/plat-omap/include/mach/gpio.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/arch/arm/plat-omap/include/mach/gpio.h b/arch/arm/plat-omap/include/mach/gpio.h index 98e9008b7e9d..04e68e88f134 100644 --- a/arch/arm/plat-omap/include/mach/gpio.h +++ b/arch/arm/plat-omap/include/mach/gpio.h | |||
@@ -71,11 +71,6 @@ | |||
71 | IH_GPIO_BASE + (nr)) | 71 | IH_GPIO_BASE + (nr)) |
72 | 72 | ||
73 | extern int omap_gpio_init(void); /* Call from board init only */ | 73 | extern int omap_gpio_init(void); /* Call from board init only */ |
74 | extern int omap_request_gpio(int gpio); | ||
75 | extern void omap_free_gpio(int gpio); | ||
76 | extern void omap_set_gpio_direction(int gpio, int is_input); | ||
77 | extern void omap_set_gpio_dataout(int gpio, int enable); | ||
78 | extern int omap_get_gpio_datain(int gpio); | ||
79 | extern void omap2_gpio_prepare_for_retention(void); | 74 | extern void omap2_gpio_prepare_for_retention(void); |
80 | extern void omap2_gpio_resume_after_retention(void); | 75 | extern void omap2_gpio_resume_after_retention(void); |
81 | extern void omap_set_gpio_debounce(int gpio, int enable); | 76 | extern void omap_set_gpio_debounce(int gpio, int enable); |
@@ -92,6 +87,16 @@ extern void omap_set_gpio_debounce_time(int gpio, int enable); | |||
92 | #include <linux/errno.h> | 87 | #include <linux/errno.h> |
93 | #include <asm-generic/gpio.h> | 88 | #include <asm-generic/gpio.h> |
94 | 89 | ||
90 | static inline int omap_request_gpio(int gpio) | ||
91 | { | ||
92 | return gpio_request(gpio, "FIXME"); | ||
93 | } | ||
94 | |||
95 | static inline void omap_free_gpio(int gpio) | ||
96 | { | ||
97 | gpio_free(gpio); | ||
98 | } | ||
99 | |||
95 | static inline int gpio_get_value(unsigned gpio) | 100 | static inline int gpio_get_value(unsigned gpio) |
96 | { | 101 | { |
97 | return __gpio_get_value(gpio); | 102 | return __gpio_get_value(gpio); |
@@ -109,16 +114,24 @@ static inline int gpio_cansleep(unsigned gpio) | |||
109 | 114 | ||
110 | static inline int gpio_to_irq(unsigned gpio) | 115 | static inline int gpio_to_irq(unsigned gpio) |
111 | { | 116 | { |
112 | if (gpio < (OMAP_MAX_GPIO_LINES + 16)) | 117 | return __gpio_to_irq(gpio); |
113 | return OMAP_GPIO_IRQ(gpio); | ||
114 | return -EINVAL; | ||
115 | } | 118 | } |
116 | 119 | ||
117 | static inline int irq_to_gpio(unsigned irq) | 120 | static inline int irq_to_gpio(unsigned irq) |
118 | { | 121 | { |
122 | int tmp; | ||
123 | |||
124 | /* omap1 SOC mpuio */ | ||
119 | if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16))) | 125 | if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16))) |
120 | return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES; | 126 | return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES; |
121 | return irq - IH_GPIO_BASE; | 127 | |
128 | /* SOC gpio */ | ||
129 | tmp = irq - IH_GPIO_BASE; | ||
130 | if (tmp < OMAP_MAX_GPIO_LINES) | ||
131 | return tmp; | ||
132 | |||
133 | /* we don't supply reverse mappings for non-SOC gpios */ | ||
134 | return -EIO; | ||
122 | } | 135 | } |
123 | 136 | ||
124 | #endif | 137 | #endif |