diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/gpio.h | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index c691df044458..0c56b9e9c209 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -77,6 +77,15 @@ static inline int irq_to_gpio(unsigned int irq) | |||
77 | 77 | ||
78 | #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ | 78 | #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ |
79 | 79 | ||
80 | /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ | ||
81 | |||
82 | struct device; | ||
83 | |||
84 | int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); | ||
85 | int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
86 | unsigned long flags, const char *label); | ||
87 | void devm_gpio_free(struct device *dev, unsigned int gpio); | ||
88 | |||
80 | #else /* ! CONFIG_GPIOLIB */ | 89 | #else /* ! CONFIG_GPIOLIB */ |
81 | 90 | ||
82 | #include <linux/kernel.h> | 91 | #include <linux/kernel.h> |
@@ -241,14 +250,25 @@ gpiochip_remove_pin_ranges(struct gpio_chip *chip) | |||
241 | WARN_ON(1); | 250 | WARN_ON(1); |
242 | } | 251 | } |
243 | 252 | ||
244 | #endif /* ! CONFIG_GPIOLIB */ | 253 | static inline int devm_gpio_request(struct device *dev, unsigned gpio, |
254 | const char *label) | ||
255 | { | ||
256 | WARN_ON(1); | ||
257 | return -EINVAL; | ||
258 | } | ||
245 | 259 | ||
246 | struct device; | 260 | static inline int devm_gpio_request_one(struct device *dev, unsigned gpio, |
261 | unsigned long flags, const char *label) | ||
262 | { | ||
263 | WARN_ON(1); | ||
264 | return -EINVAL; | ||
265 | } | ||
247 | 266 | ||
248 | /* bindings for managed devices that want to request gpios */ | 267 | static inline void devm_gpio_free(struct device *dev, unsigned int gpio) |
249 | int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); | 268 | { |
250 | int devm_gpio_request_one(struct device *dev, unsigned gpio, | 269 | WARN_ON(1); |
251 | unsigned long flags, const char *label); | 270 | } |
252 | void devm_gpio_free(struct device *dev, unsigned int gpio); | 271 | |
272 | #endif /* ! CONFIG_GPIOLIB */ | ||
253 | 273 | ||
254 | #endif /* __LINUX_GPIO_H */ | 274 | #endif /* __LINUX_GPIO_H */ |