gpio.h 634 B

123456789101112131415161718192021222324252627
  1. #ifndef __ASM_AVR32_ARCH_GPIO_H
  2. #define __ASM_AVR32_ARCH_GPIO_H
  3. #include <linux/compiler.h>
  4. #include <asm/irq.h>
  5. /* Arch-neutral GPIO API */
  6. int __must_check gpio_request(unsigned int gpio, const char *label);
  7. void gpio_free(unsigned int gpio);
  8. int gpio_direction_input(unsigned int gpio);
  9. int gpio_direction_output(unsigned int gpio);
  10. int gpio_get_value(unsigned int gpio);
  11. void gpio_set_value(unsigned int gpio, int value);
  12. static inline int gpio_to_irq(unsigned int gpio)
  13. {
  14. return gpio + GPIO_IRQ_BASE;
  15. }
  16. static inline int irq_to_gpio(unsigned int irq)
  17. {
  18. return irq - GPIO_IRQ_BASE;
  19. }
  20. #endif /* __ASM_AVR32_ARCH_GPIO_H */