gpio.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef _AU1XXX_GPIO_H_
  2. #define _AU1XXX_GPIO_H_
  3. #include <linux/types.h>
  4. #define AU1XXX_GPIO_BASE 200
  5. struct au1x00_gpio2 {
  6. u32 dir;
  7. u32 reserved;
  8. u32 output;
  9. u32 pinstate;
  10. u32 inten;
  11. u32 enable;
  12. };
  13. extern int au1xxx_gpio_get_value(unsigned gpio);
  14. extern void au1xxx_gpio_set_value(unsigned gpio, int value);
  15. extern int au1xxx_gpio_direction_input(unsigned gpio);
  16. extern int au1xxx_gpio_direction_output(unsigned gpio, int value);
  17. /* Wrappers for the arch-neutral GPIO API */
  18. static inline int gpio_request(unsigned gpio, const char *label)
  19. {
  20. /* Not yet implemented */
  21. return 0;
  22. }
  23. static inline void gpio_free(unsigned gpio)
  24. {
  25. /* Not yet implemented */
  26. }
  27. static inline int gpio_direction_input(unsigned gpio)
  28. {
  29. return au1xxx_gpio_direction_input(gpio);
  30. }
  31. static inline int gpio_direction_output(unsigned gpio, int value)
  32. {
  33. return au1xxx_gpio_direction_output(gpio, value);
  34. }
  35. static inline int gpio_get_value(unsigned gpio)
  36. {
  37. return au1xxx_gpio_get_value(gpio);
  38. }
  39. static inline void gpio_set_value(unsigned gpio, int value)
  40. {
  41. au1xxx_gpio_set_value(gpio, value);
  42. }
  43. static inline int gpio_to_irq(unsigned gpio)
  44. {
  45. return gpio;
  46. }
  47. static inline int irq_to_gpio(unsigned irq)
  48. {
  49. return irq;
  50. }
  51. /* For cansleep */
  52. #include <asm-generic/gpio.h>
  53. #endif /* _AU1XXX_GPIO_H_ */