2012-11-30 19:37:36 +08:00
|
|
|
#ifndef _LINUX_ACPI_GPIO_H_
|
|
|
|
#define _LINUX_ACPI_GPIO_H_
|
|
|
|
|
2013-04-03 18:56:54 +08:00
|
|
|
#include <linux/device.h>
|
2012-11-30 19:37:36 +08:00
|
|
|
#include <linux/errno.h>
|
2013-01-28 22:23:10 +08:00
|
|
|
#include <linux/gpio.h>
|
2012-11-30 19:37:36 +08:00
|
|
|
|
2013-04-03 18:56:54 +08: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 19:37:36 +08:00
|
|
|
#ifdef CONFIG_GPIO_ACPI
|
|
|
|
|
|
|
|
int acpi_get_gpio(char *path, int pin);
|
2013-04-03 18:56:54 +08:00
|
|
|
int acpi_get_gpio_by_index(struct device *dev, int index,
|
|
|
|
struct acpi_gpio_info *info);
|
2013-01-28 22:23:10 +08:00
|
|
|
void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
|
2013-04-09 21:57:25 +08:00
|
|
|
void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
|
2012-11-30 19:37:36 +08:00
|
|
|
|
|
|
|
#else /* CONFIG_GPIO_ACPI */
|
|
|
|
|
|
|
|
static inline int acpi_get_gpio(char *path, int pin)
|
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
2013-04-03 18:56:54 +08:00
|
|
|
static inline int acpi_get_gpio_by_index(struct device *dev, int index,
|
|
|
|
struct acpi_gpio_info *info)
|
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
2013-01-28 22:23:10 +08:00
|
|
|
static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
|
2013-04-09 21:57:25 +08:00
|
|
|
static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
|
2013-01-28 22:23:10 +08:00
|
|
|
|
2012-11-30 19:37:36 +08:00
|
|
|
#endif /* CONFIG_GPIO_ACPI */
|
|
|
|
|
|
|
|
#endif /* _LINUX_ACPI_GPIO_H_ */
|