acpi_gpio.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef _LINUX_ACPI_GPIO_H_
  2. #define _LINUX_ACPI_GPIO_H_
  3. #include <linux/device.h>
  4. #include <linux/errno.h>
  5. #include <linux/gpio.h>
  6. /**
  7. * struct acpi_gpio_info - ACPI GPIO specific information
  8. * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
  9. */
  10. struct acpi_gpio_info {
  11. bool gpioint;
  12. };
  13. #ifdef CONFIG_GPIO_ACPI
  14. int acpi_get_gpio(char *path, int pin);
  15. int acpi_get_gpio_by_index(struct device *dev, int index,
  16. struct acpi_gpio_info *info);
  17. void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
  18. void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
  19. #else /* CONFIG_GPIO_ACPI */
  20. static inline int acpi_get_gpio(char *path, int pin)
  21. {
  22. return -ENODEV;
  23. }
  24. static inline int acpi_get_gpio_by_index(struct device *dev, int index,
  25. struct acpi_gpio_info *info)
  26. {
  27. return -ENODEV;
  28. }
  29. static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
  30. static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
  31. #endif /* CONFIG_GPIO_ACPI */
  32. #endif /* _LINUX_ACPI_GPIO_H_ */