gpio.h 701 B

1234567891011121314151617181920212223242526272829
  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, int value);
  10. int gpio_get_value(unsigned int gpio);
  11. void gpio_set_value(unsigned int gpio, int value);
  12. #include <asm-generic/gpio.h> /* cansleep wrappers */
  13. static inline int gpio_to_irq(unsigned int gpio)
  14. {
  15. return gpio + GPIO_IRQ_BASE;
  16. }
  17. static inline int irq_to_gpio(unsigned int irq)
  18. {
  19. return irq - GPIO_IRQ_BASE;
  20. }
  21. #endif /* __ASM_AVR32_ARCH_GPIO_H */