nlm: Ensure callback code also checks that the files match
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / acpi_gpio.h
CommitLineData
e29482e8
MN
1#ifndef _LINUX_ACPI_GPIO_H_
2#define _LINUX_ACPI_GPIO_H_
3
12028d2d 4#include <linux/device.h>
e29482e8 5#include <linux/errno.h>
0d1c28a4 6#include <linux/gpio.h>
e29482e8 7
12028d2d
MW
8/**
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
e29482e8
MN
16#ifdef CONFIG_GPIO_ACPI
17
18int acpi_get_gpio(char *path, int pin);
12028d2d
MW
19int acpi_get_gpio_by_index(struct device *dev, int index,
20 struct acpi_gpio_info *info);
0d1c28a4 21void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
7fc7acb9 22void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
e29482e8
MN
23
24#else /* CONFIG_GPIO_ACPI */
25
26static inline int acpi_get_gpio(char *path, int pin)
27{
28 return -ENODEV;
29}
30
12028d2d
MW
31static inline int acpi_get_gpio_by_index(struct device *dev, int index,
32 struct acpi_gpio_info *info)
33{
34 return -ENODEV;
35}
36
0d1c28a4 37static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
7fc7acb9 38static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
0d1c28a4 39
e29482e8
MN
40#endif /* CONFIG_GPIO_ACPI */
41
42#endif /* _LINUX_ACPI_GPIO_H_ */