Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / gpio / gpiolib-acpi.h
blob7e1c51d04040be0ac42c37c840ffbec6f2293a78
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * ACPI helpers for GPIO API
5 * Copyright (C) 2012,2019 Intel Corporation
6 */
8 #ifndef GPIOLIB_ACPI_H
9 #define GPIOLIB_ACPI_H
11 #include <linux/err.h>
12 #include <linux/types.h>
14 #include <linux/gpio/consumer.h>
16 struct device;
17 struct fwnode_handle;
19 struct gpio_chip;
20 struct gpio_desc;
21 struct gpio_device;
23 #ifdef CONFIG_ACPI
24 void acpi_gpiochip_add(struct gpio_chip *chip);
25 void acpi_gpiochip_remove(struct gpio_chip *chip);
27 void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
28 void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
30 struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode,
31 const char *con_id,
32 unsigned int idx,
33 enum gpiod_flags *dflags,
34 unsigned long *lookupflags);
36 int acpi_gpio_count(const struct fwnode_handle *fwnode, const char *con_id);
37 #else
38 static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
39 static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
41 static inline void
42 acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
44 static inline void
45 acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
47 static inline struct gpio_desc *
48 acpi_find_gpio(struct fwnode_handle *fwnode, const char *con_id,
49 unsigned int idx, enum gpiod_flags *dflags,
50 unsigned long *lookupflags)
52 return ERR_PTR(-ENOENT);
54 static inline int acpi_gpio_count(const struct fwnode_handle *fwnode,
55 const char *con_id)
57 return -ENODEV;
59 #endif
61 #endif /* GPIOLIB_ACPI_H */