gpio.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _RDC321X_GPIO_H
  2. #define _RDC321X_GPIO_H
  3. extern int rdc_gpio_get_value(unsigned gpio);
  4. extern void rdc_gpio_set_value(unsigned gpio, int value);
  5. extern int rdc_gpio_direction_input(unsigned gpio);
  6. extern int rdc_gpio_direction_output(unsigned gpio, int value);
  7. extern int rdc_gpio_request(unsigned gpio, const char *label);
  8. extern void rdc_gpio_free(unsigned gpio);
  9. extern void __init rdc321x_gpio_setup(void);
  10. /* Wrappers for the arch-neutral GPIO API */
  11. static inline int gpio_request(unsigned gpio, const char *label)
  12. {
  13. return rdc_gpio_request(gpio, label);
  14. }
  15. static inline void gpio_free(unsigned gpio)
  16. {
  17. rdc_gpio_free(gpio);
  18. }
  19. static inline int gpio_direction_input(unsigned gpio)
  20. {
  21. return rdc_gpio_direction_input(gpio);
  22. }
  23. static inline int gpio_direction_output(unsigned gpio, int value)
  24. {
  25. return rdc_gpio_direction_output(gpio, value);
  26. }
  27. static inline int gpio_get_value(unsigned gpio)
  28. {
  29. return rdc_gpio_get_value(gpio);
  30. }
  31. static inline void gpio_set_value(unsigned gpio, int value)
  32. {
  33. rdc_gpio_set_value(gpio, value);
  34. }
  35. static inline int gpio_to_irq(unsigned gpio)
  36. {
  37. return gpio;
  38. }
  39. static inline int irq_to_gpio(unsigned irq)
  40. {
  41. return irq;
  42. }
  43. /* For cansleep */
  44. #include <asm-generic/gpio.h>
  45. #endif /* _RDC321X_GPIO_H_ */