Florian Fainelli | 5e3a77e | 2008-01-30 13:33:36 +0100 | [diff] [blame] | 1 | #ifndef _RDC321X_GPIO_H |
| 2 | #define _RDC321X_GPIO_H |
| 3 | |
| 4 | extern int rdc_gpio_get_value(unsigned gpio); |
| 5 | extern void rdc_gpio_set_value(unsigned gpio, int value); |
| 6 | extern int rdc_gpio_direction_input(unsigned gpio); |
| 7 | extern int rdc_gpio_direction_output(unsigned gpio, int value); |
Florian Fainelli | b2ef749 | 2008-03-26 22:39:15 +0100 | [diff] [blame] | 8 | extern int rdc_gpio_request(unsigned gpio, const char *label); |
| 9 | extern void rdc_gpio_free(unsigned gpio); |
| 10 | extern void __init rdc321x_gpio_setup(void); |
Florian Fainelli | 5e3a77e | 2008-01-30 13:33:36 +0100 | [diff] [blame] | 11 | |
| 12 | /* Wrappers for the arch-neutral GPIO API */ |
| 13 | |
| 14 | static inline int gpio_request(unsigned gpio, const char *label) |
| 15 | { |
Florian Fainelli | b2ef749 | 2008-03-26 22:39:15 +0100 | [diff] [blame] | 16 | return rdc_gpio_request(gpio, label); |
Florian Fainelli | 5e3a77e | 2008-01-30 13:33:36 +0100 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | static inline void gpio_free(unsigned gpio) |
| 20 | { |
Florian Fainelli | b2ef749 | 2008-03-26 22:39:15 +0100 | [diff] [blame] | 21 | rdc_gpio_free(gpio); |
Florian Fainelli | 5e3a77e | 2008-01-30 13:33:36 +0100 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | static inline int gpio_direction_input(unsigned gpio) |
| 25 | { |
| 26 | return rdc_gpio_direction_input(gpio); |
| 27 | } |
| 28 | |
| 29 | static inline int gpio_direction_output(unsigned gpio, int value) |
| 30 | { |
| 31 | return rdc_gpio_direction_output(gpio, value); |
| 32 | } |
| 33 | |
| 34 | static inline int gpio_get_value(unsigned gpio) |
| 35 | { |
| 36 | return rdc_gpio_get_value(gpio); |
| 37 | } |
| 38 | |
| 39 | static inline void gpio_set_value(unsigned gpio, int value) |
| 40 | { |
| 41 | rdc_gpio_set_value(gpio, value); |
| 42 | } |
| 43 | |
| 44 | static inline int gpio_to_irq(unsigned gpio) |
| 45 | { |
| 46 | return gpio; |
| 47 | } |
| 48 | |
| 49 | static 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_ */ |