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