gpio.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. /* Wrappers for the arch-neutral GPIO API */
  8. static inline int gpio_request(unsigned gpio, const char *label)
  9. {
  10. /* Not yet implemented */
  11. return 0;
  12. }
  13. static inline void gpio_free(unsigned gpio)
  14. {
  15. /* Not yet implemented */
  16. }
  17. static inline int gpio_direction_input(unsigned gpio)
  18. {
  19. return rdc_gpio_direction_input(gpio);
  20. }
  21. static inline int gpio_direction_output(unsigned gpio, int value)
  22. {
  23. return rdc_gpio_direction_output(gpio, value);
  24. }
  25. static inline int gpio_get_value(unsigned gpio)
  26. {
  27. return rdc_gpio_get_value(gpio);
  28. }
  29. static inline void gpio_set_value(unsigned gpio, int value)
  30. {
  31. rdc_gpio_set_value(gpio, value);
  32. }
  33. static inline int gpio_to_irq(unsigned gpio)
  34. {
  35. return gpio;
  36. }
  37. static inline int irq_to_gpio(unsigned irq)
  38. {
  39. return irq;
  40. }
  41. /* For cansleep */
  42. #include <asm-generic/gpio.h>
  43. #endif /* _RDC321X_GPIO_H_ */