Mathias Nyman | e29482e | 2012-11-30 12:37:36 +0100 | [diff] [blame] | 1 | #ifndef _LINUX_ACPI_GPIO_H_ |
| 2 | #define _LINUX_ACPI_GPIO_H_ |
| 3 | |
Mika Westerberg | 12028d2 | 2013-04-03 13:56:54 +0300 | [diff] [blame] | 4 | #include <linux/device.h> |
Mathias Nyman | e29482e | 2012-11-30 12:37:36 +0100 | [diff] [blame] | 5 | #include <linux/errno.h> |
Mathias Nyman | 0d1c28a | 2013-01-28 16:23:10 +0200 | [diff] [blame] | 6 | #include <linux/gpio.h> |
Mathias Nyman | e29482e | 2012-11-30 12:37:36 +0100 | [diff] [blame] | 7 | |
Mika Westerberg | 12028d2 | 2013-04-03 13:56:54 +0300 | [diff] [blame] | 8 | /** |
| 9 | * struct acpi_gpio_info - ACPI GPIO specific information |
| 10 | * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo |
| 11 | */ |
| 12 | struct acpi_gpio_info { |
| 13 | bool gpioint; |
| 14 | }; |
| 15 | |
Mathias Nyman | e29482e | 2012-11-30 12:37:36 +0100 | [diff] [blame] | 16 | #ifdef CONFIG_GPIO_ACPI |
| 17 | |
| 18 | int acpi_get_gpio(char *path, int pin); |
Mika Westerberg | 12028d2 | 2013-04-03 13:56:54 +0300 | [diff] [blame] | 19 | int acpi_get_gpio_by_index(struct device *dev, int index, |
| 20 | struct acpi_gpio_info *info); |
Mathias Nyman | 0d1c28a | 2013-01-28 16:23:10 +0200 | [diff] [blame] | 21 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); |
Rafael J. Wysocki | 7fc7acb | 2013-04-09 15:57:25 +0200 | [diff] [blame] | 22 | void acpi_gpiochip_free_interrupts(struct gpio_chip *chip); |
Mathias Nyman | e29482e | 2012-11-30 12:37:36 +0100 | [diff] [blame] | 23 | |
| 24 | #else /* CONFIG_GPIO_ACPI */ |
| 25 | |
| 26 | static inline int acpi_get_gpio(char *path, int pin) |
| 27 | { |
| 28 | return -ENODEV; |
| 29 | } |
| 30 | |
Mika Westerberg | 12028d2 | 2013-04-03 13:56:54 +0300 | [diff] [blame] | 31 | static inline int acpi_get_gpio_by_index(struct device *dev, int index, |
| 32 | struct acpi_gpio_info *info) |
| 33 | { |
| 34 | return -ENODEV; |
| 35 | } |
| 36 | |
Mathias Nyman | 0d1c28a | 2013-01-28 16:23:10 +0200 | [diff] [blame] | 37 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } |
Rafael J. Wysocki | 7fc7acb | 2013-04-09 15:57:25 +0200 | [diff] [blame] | 38 | static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { } |
Mathias Nyman | 0d1c28a | 2013-01-28 16:23:10 +0200 | [diff] [blame] | 39 | |
Mathias Nyman | e29482e | 2012-11-30 12:37:36 +0100 | [diff] [blame] | 40 | #endif /* CONFIG_GPIO_ACPI */ |
| 41 | |
| 42 | #endif /* _LINUX_ACPI_GPIO_H_ */ |