2012-11-30 18:37:36 +07:00
|
|
|
#ifndef _LINUX_ACPI_GPIO_H_
|
|
|
|
#define _LINUX_ACPI_GPIO_H_
|
|
|
|
|
2013-04-03 17:56:54 +07:00
|
|
|
#include <linux/device.h>
|
2012-11-30 18:37:36 +07:00
|
|
|
#include <linux/errno.h>
|
2013-01-28 21:23:10 +07:00
|
|
|
#include <linux/gpio.h>
|
2012-11-30 18:37:36 +07:00
|
|
|
|
2013-04-03 17:56:54 +07:00
|
|
|
/**
|
|
|
|
* struct acpi_gpio_info - ACPI GPIO specific information
|
|
|
|
* @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
|
|
|
|
*/
|
|
|
|
struct acpi_gpio_info {
|
|
|
|
bool gpioint;
|
|
|
|
};
|
|
|
|
|
2012-11-30 18:37:36 +07:00
|
|
|
#ifdef CONFIG_GPIO_ACPI
|
|
|
|
|
|
|
|
int acpi_get_gpio(char *path, int pin);
|
2013-04-03 17:56:54 +07:00
|
|
|
int acpi_get_gpio_by_index(struct device *dev, int index,
|
|
|
|
struct acpi_gpio_info *info);
|
2013-01-28 21:23:10 +07:00
|
|
|
void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
|
2013-04-09 20:57:25 +07:00
|
|
|
void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
|
2012-11-30 18:37:36 +07:00
|
|
|
|
|
|
|
#else /* CONFIG_GPIO_ACPI */
|
|
|
|
|
|
|
|
static inline int acpi_get_gpio(char *path, int pin)
|
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
2013-04-03 17:56:54 +07:00
|
|
|
static inline int acpi_get_gpio_by_index(struct device *dev, int index,
|
|
|
|
struct acpi_gpio_info *info)
|
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
2013-01-28 21:23:10 +07:00
|
|
|
static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
|
2013-04-09 20:57:25 +07:00
|
|
|
static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
|
2013-01-28 21:23:10 +07:00
|
|
|
|
2012-11-30 18:37:36 +07:00
|
|
|
#endif /* CONFIG_GPIO_ACPI */
|
|
|
|
|
|
|
|
#endif /* _LINUX_ACPI_GPIO_H_ */
|