This source file includes following definitions.
- acpi_gpiochip_add
- acpi_gpiochip_remove
- acpi_gpiochip_request_interrupts
- acpi_gpiochip_free_interrupts
- acpi_gpio_update_gpiod_flags
- acpi_gpio_update_gpiod_lookup_flags
- acpi_find_gpio
- acpi_node_get_gpiod
- acpi_gpio_count
1
2
3
4
5
6
7
8 #ifndef GPIOLIB_ACPI_H
9 #define GPIOLIB_ACPI_H
10
11 struct acpi_device;
12
13
14
15
16
17
18
19
20
21
22
23 struct acpi_gpio_info {
24 struct acpi_device *adev;
25 enum gpiod_flags flags;
26 bool gpioint;
27 int pin_config;
28 int polarity;
29 int triggering;
30 unsigned int quirks;
31 };
32
33 #ifdef CONFIG_ACPI
34 void acpi_gpiochip_add(struct gpio_chip *chip);
35 void acpi_gpiochip_remove(struct gpio_chip *chip);
36
37 void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
38 void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
39
40 int acpi_gpio_update_gpiod_flags(enum gpiod_flags *flags,
41 struct acpi_gpio_info *info);
42 int acpi_gpio_update_gpiod_lookup_flags(unsigned long *lookupflags,
43 struct acpi_gpio_info *info);
44
45 struct gpio_desc *acpi_find_gpio(struct device *dev,
46 const char *con_id,
47 unsigned int idx,
48 enum gpiod_flags *dflags,
49 unsigned long *lookupflags);
50 struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode,
51 const char *propname, int index,
52 struct acpi_gpio_info *info);
53
54 int acpi_gpio_count(struct device *dev, const char *con_id);
55 #else
56 static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
57 static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
58
59 static inline void
60 acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
61
62 static inline void
63 acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
64
65 static inline int
66 acpi_gpio_update_gpiod_flags(enum gpiod_flags *flags, struct acpi_gpio_info *info)
67 {
68 return 0;
69 }
70 static inline int
71 acpi_gpio_update_gpiod_lookup_flags(unsigned long *lookupflags,
72 struct acpi_gpio_info *info)
73 {
74 return 0;
75 }
76
77 static inline struct gpio_desc *
78 acpi_find_gpio(struct device *dev, const char *con_id,
79 unsigned int idx, enum gpiod_flags *dflags,
80 unsigned long *lookupflags)
81 {
82 return ERR_PTR(-ENOENT);
83 }
84 static inline struct gpio_desc *
85 acpi_node_get_gpiod(struct fwnode_handle *fwnode, const char *propname,
86 int index, struct acpi_gpio_info *info)
87 {
88 return ERR_PTR(-ENXIO);
89 }
90 static inline int acpi_gpio_count(struct device *dev, const char *con_id)
91 {
92 return -ENODEV;
93 }
94 #endif
95
96 #endif