gpiolib-of.h (1285B)
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); 18void of_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev); 19#else 20static inline struct gpio_desc *of_find_gpio(struct device *dev, 21 const char *con_id, 22 unsigned int idx, 23 unsigned long *lookupflags) 24{ 25 return ERR_PTR(-ENOENT); 26} 27static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; } 28static inline void of_gpiochip_remove(struct gpio_chip *gc) { } 29static inline int of_gpio_get_count(struct device *dev, const char *con_id) 30{ 31 return 0; 32} 33static inline bool of_gpio_need_valid_mask(const struct gpio_chip *gc) 34{ 35 return false; 36} 37static inline void of_gpio_dev_init(struct gpio_chip *gc, 38 struct gpio_device *gdev) 39{ 40} 41#endif /* CONFIG_OF_GPIO */ 42 43extern struct notifier_block gpio_of_notifier; 44 45#endif /* GPIOLIB_OF_H */