Linux Audio

Check our new training course

Loading...
v6.13.7
 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;
12struct fwnode_handle;
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_count(const struct fwnode_handle *fwnode, const char *con_id);
 
26#else
27static inline struct gpio_desc *of_find_gpio(struct device_node *np,
28					     const char *con_id,
29					     unsigned int idx,
30					     unsigned long *lookupflags)
31{
32	return ERR_PTR(-ENOENT);
33}
34static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
35static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
36static inline int of_gpio_count(const struct fwnode_handle *fwnode,
37				const char *con_id)
38{
39	return 0;
40}
 
 
 
 
41#endif /* CONFIG_OF_GPIO */
42
43extern struct notifier_block gpio_of_notifier;
44
45#endif /* GPIOLIB_OF_H */
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2
 3#ifndef GPIOLIB_OF_H
 4#define GPIOLIB_OF_H
 5
 
 
 
 
 
 
 
 
 6struct gpio_chip;
 7enum of_gpio_flags;
 
 8
 9#ifdef CONFIG_OF_GPIO
10struct gpio_desc *of_find_gpio(struct device *dev,
11			       const char *con_id,
12			       unsigned int idx,
13			       unsigned long *lookupflags);
14int of_gpiochip_add(struct gpio_chip *gc);
15void of_gpiochip_remove(struct gpio_chip *gc);
16int of_gpio_get_count(struct device *dev, const char *con_id);
17bool of_gpio_need_valid_mask(const struct gpio_chip *gc);
18#else
19static inline struct gpio_desc *of_find_gpio(struct device *dev,
20					     const char *con_id,
21					     unsigned int idx,
22					     unsigned long *lookupflags)
23{
24	return ERR_PTR(-ENOENT);
25}
26static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
27static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
28static inline int of_gpio_get_count(struct device *dev, const char *con_id)
 
29{
30	return 0;
31}
32static inline bool of_gpio_need_valid_mask(const struct gpio_chip *gc)
33{
34	return false;
35}
36#endif /* CONFIG_OF_GPIO */
 
 
37
38#endif /* GPIOLIB_OF_H */