![Mathias Nyman](/assets/img/avatar_default.png)
Add ability to handle ACPI events signalled by GPIO interrupts. ACPI5 platforms can use GPIO signaled ACPI events. These GPIO interrupts are handled by ACPI event methods which need to be called from the GPIO controller's interrupt handler. acpi_gpio_request_interrupt() finds out which gpio pins have acpi event methods and assigns interrupt handlers that calls the acpi event methods for those pins. Partially based on work by Rui Zhang <rui.zhang@intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
24 lines
486 B
C
24 lines
486 B
C
#ifndef _LINUX_ACPI_GPIO_H_
|
|
#define _LINUX_ACPI_GPIO_H_
|
|
|
|
#include <linux/errno.h>
|
|
#include <linux/gpio.h>
|
|
|
|
#ifdef CONFIG_GPIO_ACPI
|
|
|
|
int acpi_get_gpio(char *path, int pin);
|
|
void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
|
|
|
|
#else /* CONFIG_GPIO_ACPI */
|
|
|
|
static inline int acpi_get_gpio(char *path, int pin)
|
|
{
|
|
return -ENODEV;
|
|
}
|
|
|
|
static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
|
|
|
|
#endif /* CONFIG_GPIO_ACPI */
|
|
|
|
#endif /* _LINUX_ACPI_GPIO_H_ */
|