blob: 4c120a1e0ca3b0cbe4070f20b7a2905582f62b6c [file] [log] [blame]
Mathias Nymane29482e2012-11-30 12:37:36 +01001#ifndef _LINUX_ACPI_GPIO_H_
2#define _LINUX_ACPI_GPIO_H_
3
Mika Westerberg12028d22013-04-03 13:56:54 +03004#include <linux/device.h>
Mathias Nymane29482e2012-11-30 12:37:36 +01005#include <linux/errno.h>
Mathias Nyman0d1c28a2013-01-28 16:23:10 +02006#include <linux/gpio.h>
Mathias Nymane29482e2012-11-30 12:37:36 +01007
Mika Westerberg12028d22013-04-03 13:56:54 +03008/**
9 * struct acpi_gpio_info - ACPI GPIO specific information
10 * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
11 */
12struct acpi_gpio_info {
13 bool gpioint;
14};
15
Mathias Nymane29482e2012-11-30 12:37:36 +010016#ifdef CONFIG_GPIO_ACPI
17
18int acpi_get_gpio(char *path, int pin);
Mika Westerberg12028d22013-04-03 13:56:54 +030019int acpi_get_gpio_by_index(struct device *dev, int index,
20 struct acpi_gpio_info *info);
Mathias Nyman0d1c28a2013-01-28 16:23:10 +020021void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
Rafael J. Wysocki7fc7acb2013-04-09 15:57:25 +020022void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
Mathias Nymane29482e2012-11-30 12:37:36 +010023
24#else /* CONFIG_GPIO_ACPI */
25
26static inline int acpi_get_gpio(char *path, int pin)
27{
28 return -ENODEV;
29}
30
Mika Westerberg12028d22013-04-03 13:56:54 +030031static 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 Nyman0d1c28a2013-01-28 16:23:10 +020037static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
Rafael J. Wysocki7fc7acb2013-04-09 15:57:25 +020038static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
Mathias Nyman0d1c28a2013-01-28 16:23:10 +020039
Mathias Nymane29482e2012-11-30 12:37:36 +010040#endif /* CONFIG_GPIO_ACPI */
41
42#endif /* _LINUX_ACPI_GPIO_H_ */