blob: acce0b7d397bb2465ee89beb6e8a7d817bccbc7a [file] [log] [blame]
Florian Fainelli5e3a77e2008-01-30 13:33:36 +01001#ifndef _RDC321X_GPIO_H
2#define _RDC321X_GPIO_H
3
4extern int rdc_gpio_get_value(unsigned gpio);
5extern void rdc_gpio_set_value(unsigned gpio, int value);
6extern int rdc_gpio_direction_input(unsigned gpio);
7extern int rdc_gpio_direction_output(unsigned gpio, int value);
Florian Fainellib2ef7492008-03-26 22:39:15 +01008extern int rdc_gpio_request(unsigned gpio, const char *label);
9extern void rdc_gpio_free(unsigned gpio);
10extern void __init rdc321x_gpio_setup(void);
Florian Fainelli5e3a77e2008-01-30 13:33:36 +010011
12/* Wrappers for the arch-neutral GPIO API */
13
14static inline int gpio_request(unsigned gpio, const char *label)
15{
Florian Fainellib2ef7492008-03-26 22:39:15 +010016 return rdc_gpio_request(gpio, label);
Florian Fainelli5e3a77e2008-01-30 13:33:36 +010017}
18
19static inline void gpio_free(unsigned gpio)
20{
Florian Fainellib2ef7492008-03-26 22:39:15 +010021 rdc_gpio_free(gpio);
Florian Fainelli5e3a77e2008-01-30 13:33:36 +010022}
23
24static inline int gpio_direction_input(unsigned gpio)
25{
26 return rdc_gpio_direction_input(gpio);
27}
28
29static inline int gpio_direction_output(unsigned gpio, int value)
30{
31 return rdc_gpio_direction_output(gpio, value);
32}
33
34static inline int gpio_get_value(unsigned gpio)
35{
36 return rdc_gpio_get_value(gpio);
37}
38
39static inline void gpio_set_value(unsigned gpio, int value)
40{
41 rdc_gpio_set_value(gpio, value);
42}
43
44static inline int gpio_to_irq(unsigned gpio)
45{
46 return gpio;
47}
48
49static inline int irq_to_gpio(unsigned irq)
50{
51 return irq;
52}
53
54/* For cansleep */
55#include <asm-generic/gpio.h>
56
57#endif /* _RDC321X_GPIO_H_ */