• Home
  • Raw
  • Download

Lines Matching +full:a +full:- +full:gpio

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * <linux/gpio.h>
5 * This is the LEGACY GPIO bulk include file, including legacy APIs. It is
6 * used for GPIO drivers still referencing the global GPIO numberspace,
9 * If you're implementing a GPIO driver, only include <linux/gpio/driver.h>
10 * If you're implementing a GPIO consumer, only include <linux/gpio/consumer.h>
17 /* see Documentation/driver-api/gpio/legacy.rst */
19 /* make these flag values available regardless of GPIO kconfig options */
30 /* Gpio pin is active-low */
33 /* Gpio pin is open drain */
36 /* Gpio pin is open source */
45 * struct gpio - a structure describing a GPIO with configuration
46 * @gpio: the GPIO number
47 * @flags: GPIO configuration as specified by GPIOF_*
48 * @label: a literal description string of this GPIO
50 struct gpio {
51 unsigned gpio;
59 #include <asm/gpio.h>
62 #include <asm-generic/gpio.h>
64 static inline int gpio_get_value(unsigned int gpio)
66 return __gpio_get_value(gpio);
69 static inline void gpio_set_value(unsigned int gpio, int value)
71 __gpio_set_value(gpio, value);
74 static inline int gpio_cansleep(unsigned int gpio)
76 return __gpio_cansleep(gpio);
79 static inline int gpio_to_irq(unsigned int gpio)
81 return __gpio_to_irq(gpio);
86 return -EINVAL;
95 int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
96 int devm_gpio_request_one(struct device *dev, unsigned gpio,
98 void devm_gpio_free(struct device *dev, unsigned int gpio);
114 static inline int gpio_request(unsigned gpio, const char *label)
116 return -ENOSYS;
119 static inline int gpio_request_one(unsigned gpio,
122 return -ENOSYS;
125 static inline int gpio_request_array(const struct gpio *array, size_t num)
127 return -ENOSYS;
130 static inline void gpio_free(unsigned gpio)
134 /* GPIO can never have been requested */
138 static inline void gpio_free_array(const struct gpio *array, size_t num)
142 /* GPIO can never have been requested */
146 static inline int gpio_direction_input(unsigned gpio)
148 return -ENOSYS;
151 static inline int gpio_direction_output(unsigned gpio, int value)
153 return -ENOSYS;
156 static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
158 return -ENOSYS;
161 static inline int gpio_get_value(unsigned gpio)
163 /* GPIO can never have been requested or set as {in,out}put */
168 static inline void gpio_set_value(unsigned gpio, int value)
170 /* GPIO can never have been requested or set as output */
174 static inline int gpio_cansleep(unsigned gpio)
176 /* GPIO can never have been requested or set as {in,out}put */
181 static inline int gpio_get_value_cansleep(unsigned gpio)
183 /* GPIO can never have been requested or set as {in,out}put */
188 static inline void gpio_set_value_cansleep(unsigned gpio, int value)
190 /* GPIO can never have been requested or set as output */
194 static inline int gpio_export(unsigned gpio, bool direction_may_change)
196 /* GPIO can never have been requested or set as {in,out}put */
198 return -EINVAL;
202 unsigned gpio)
204 /* GPIO can never have been exported */
206 return -EINVAL;
209 static inline void gpio_unexport(unsigned gpio)
211 /* GPIO can never have been exported */
215 static inline int gpio_to_irq(unsigned gpio)
217 /* GPIO can never have been requested or set as input */
219 return -EINVAL;
226 return -EINVAL;
229 static inline int devm_gpio_request(struct device *dev, unsigned gpio,
233 return -EINVAL;
236 static inline int devm_gpio_request_one(struct device *dev, unsigned gpio,
240 return -EINVAL;
243 static inline void devm_gpio_free(struct device *dev, unsigned int gpio)