aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-at91/gpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/arch-at91/gpio.h')
-rw-r--r--include/asm-arm/arch-at91/gpio.h48
1 files changed, 46 insertions, 2 deletions
diff --git a/include/asm-arm/arch-at91/gpio.h b/include/asm-arm/arch-at91/gpio.h
index 256f9b200ab2..98ad2114f43a 100644
--- a/include/asm-arm/arch-at91/gpio.h
+++ b/include/asm-arm/arch-at91/gpio.h
@@ -188,6 +188,7 @@
188 188
189#ifndef __ASSEMBLY__ 189#ifndef __ASSEMBLY__
190/* setup setup routines, called from board init or driver probe() */ 190/* setup setup routines, called from board init or driver probe() */
191extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup);
191extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup); 192extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup);
192extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup); 193extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup);
193extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup); 194extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup);
@@ -202,7 +203,50 @@ extern int at91_get_gpio_value(unsigned pin);
202/* callable only from core power-management code */ 203/* callable only from core power-management code */
203extern void at91_gpio_suspend(void); 204extern void at91_gpio_suspend(void);
204extern void at91_gpio_resume(void); 205extern void at91_gpio_resume(void);
205#endif
206 206
207#endif 207/*-------------------------------------------------------------------------*/
208
209/* wrappers for "new style" GPIO calls. the old AT91-specfic ones should
210 * eventually be removed (along with this errno.h inclusion), and the
211 * gpio request/free calls should probably be implemented.
212 */
213
214#include <asm/errno.h>
215
216static inline int gpio_request(unsigned gpio, const char *label)
217{
218 return 0;
219}
220
221static inline void gpio_free(unsigned gpio)
222{
223}
224
225extern int gpio_direction_input(unsigned gpio);
226extern int gpio_direction_output(unsigned gpio);
208 227
228static inline int gpio_get_value(unsigned gpio)
229{
230 return at91_get_gpio_value(gpio);
231}
232
233static inline void gpio_set_value(unsigned gpio, int value)
234{
235 at91_set_gpio_value(gpio, value);
236}
237
238#include <asm-generic/gpio.h> /* cansleep wrappers */
239
240static inline int gpio_to_irq(unsigned gpio)
241{
242 return gpio;
243}
244
245static inline int irq_to_gpio(unsigned irq)
246{
247 return irq;
248}
249
250#endif /* __ASSEMBLY__ */
251
252#endif