// SPDX-License-Identifier: GPL-2.0 #include <linux/bitops.h> #include <linux/device.h> #include <linux/errno.h> #include <linux/export.h> #include <linux/gfp.h> #include <linux/gpio/consumer.h> #include <linux/gpio/driver.h> #include <linux/gpio.h> #include "gpiolib.h" /* * **DEPRECATED** This function is deprecated and must not be used in new code. */ void gpio_free(unsigned gpio) { … } EXPORT_SYMBOL_GPL(…); /** * gpio_request_one - request a single GPIO with initial configuration * @gpio: the GPIO number * @flags: GPIO configuration as specified by GPIOF_* * @label: a literal description string of this GPIO * * **DEPRECATED** This function is deprecated and must not be used in new code. * * Returns: * 0 on success, or negative errno on failure. */ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) { … } EXPORT_SYMBOL_GPL(…); /* * **DEPRECATED** This function is deprecated and must not be used in new code. */ int gpio_request(unsigned gpio, const char *label) { … } EXPORT_SYMBOL_GPL(…); static void devm_gpio_release(struct device *dev, void *res) { … } /** * devm_gpio_request - request a GPIO for a managed device * @dev: device to request the GPIO for * @gpio: GPIO to allocate * @label: the name of the requested GPIO * * Except for the extra @dev argument, this function takes the * same arguments and performs the same function as gpio_request(). * GPIOs requested with this function will be automatically freed * on driver detach. * * **DEPRECATED** This function is deprecated and must not be used in new code. * * Returns: * 0 on success, or negative errno on failure. */ int devm_gpio_request(struct device *dev, unsigned gpio, const char *label) { … } EXPORT_SYMBOL_GPL(…); /** * devm_gpio_request_one - request a single GPIO with initial setup * @dev: device to request for * @gpio: the GPIO number * @flags: GPIO configuration as specified by GPIOF_* * @label: a literal description string of this GPIO * * **DEPRECATED** This function is deprecated and must not be used in new code. * * Returns: * 0 on success, or negative errno on failure. */ int devm_gpio_request_one(struct device *dev, unsigned gpio, unsigned long flags, const char *label) { … } EXPORT_SYMBOL_GPL(…);