Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0 */
 2
 3#ifndef GPIOLIB_OF_H
 4#define GPIOLIB_OF_H
 5
 6#include <linux/err.h>
 
 7#include <linux/types.h>
 8
 9#include <linux/notifier.h>
10
11struct device;
12
13struct gpio_chip;
14struct gpio_desc;
15struct gpio_device;
16
17#ifdef CONFIG_OF_GPIO
18struct gpio_desc *of_find_gpio(struct device_node *np,
19			       const char *con_id,
20			       unsigned int idx,
21			       unsigned long *lookupflags);
22int of_gpiochip_add(struct gpio_chip *gc);
23void of_gpiochip_remove(struct gpio_chip *gc);
24int of_gpio_get_count(struct device *dev, const char *con_id);
 
25#else
26static inline struct gpio_desc *of_find_gpio(struct device_node *np,
27					     const char *con_id,
28					     unsigned int idx,
29					     unsigned long *lookupflags)
30{
31	return ERR_PTR(-ENOENT);
32}
33static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
34static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
35static inline int of_gpio_get_count(struct device *dev, const char *con_id)
36{
37	return 0;
 
 
 
 
38}
39#endif /* CONFIG_OF_GPIO */
40
41extern struct notifier_block gpio_of_notifier;
42
43#endif /* GPIOLIB_OF_H */
v6.2
 1/* SPDX-License-Identifier: GPL-2.0 */
 2
 3#ifndef GPIOLIB_OF_H
 4#define GPIOLIB_OF_H
 5
 6#include <linux/err.h>
 7#include <linux/errno.h>
 8#include <linux/types.h>
 9
10#include <linux/notifier.h>
11
12struct device;
13
14struct gpio_chip;
15struct gpio_desc;
16struct gpio_device;
17
18#ifdef CONFIG_OF_GPIO
19struct gpio_desc *of_find_gpio(struct device_node *np,
20			       const char *con_id,
21			       unsigned int idx,
22			       unsigned long *lookupflags);
23int of_gpiochip_add(struct gpio_chip *gc);
24void of_gpiochip_remove(struct gpio_chip *gc);
25int of_gpio_get_count(struct device *dev, const char *con_id);
26void of_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev);
27#else
28static inline struct gpio_desc *of_find_gpio(struct device_node *np,
29					     const char *con_id,
30					     unsigned int idx,
31					     unsigned long *lookupflags)
32{
33	return ERR_PTR(-ENOENT);
34}
35static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
36static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
37static inline int of_gpio_get_count(struct device *dev, const char *con_id)
38{
39	return 0;
40}
41static inline void of_gpio_dev_init(struct gpio_chip *gc,
42				    struct gpio_device *gdev)
43{
44}
45#endif /* CONFIG_OF_GPIO */
46
47extern struct notifier_block gpio_of_notifier;
48
49#endif /* GPIOLIB_OF_H */