Lines Matching refs:gpio

11 #include <linux/gpio/driver.h>
12 #include <linux/gpio/consumer.h>
50 struct gpio;
56 /* caller holds gpio_lock *OR* gpio is marked as requested */
57 static inline struct gpio_chip *gpio_to_chip(unsigned gpio)
59 return gpiod_to_chip(gpio_to_desc(gpio));
65 extern int gpio_request(unsigned gpio, const char *label);
66 extern void gpio_free(unsigned gpio);
68 static inline int gpio_direction_input(unsigned gpio)
70 return gpiod_direction_input(gpio_to_desc(gpio));
72 static inline int gpio_direction_output(unsigned gpio, int value)
74 return gpiod_direction_output_raw(gpio_to_desc(gpio), value);
77 static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
79 return gpiod_set_debounce(gpio_to_desc(gpio), debounce);
82 static inline int gpio_get_value_cansleep(unsigned gpio)
84 return gpiod_get_raw_value_cansleep(gpio_to_desc(gpio));
86 static inline void gpio_set_value_cansleep(unsigned gpio, int value)
88 return gpiod_set_raw_value_cansleep(gpio_to_desc(gpio), value);
92 /* A platform's <asm/gpio.h> code may want to inline the I/O calls when
96 static inline int __gpio_get_value(unsigned gpio)
98 return gpiod_get_raw_value(gpio_to_desc(gpio));
100 static inline void __gpio_set_value(unsigned gpio, int value)
102 return gpiod_set_raw_value(gpio_to_desc(gpio), value);
105 static inline int __gpio_cansleep(unsigned gpio)
107 return gpiod_cansleep(gpio_to_desc(gpio));
110 static inline int __gpio_to_irq(unsigned gpio)
112 return gpiod_to_irq(gpio_to_desc(gpio));
115 extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
116 extern int gpio_request_array(const struct gpio *array, size_t num);
117 extern void gpio_free_array(const struct gpio *array, size_t num);
123 static inline int gpio_export(unsigned gpio, bool direction_may_change)
125 return gpiod_export(gpio_to_desc(gpio), direction_may_change);
129 unsigned gpio)
131 return gpiod_export_link(dev, name, gpio_to_desc(gpio));
134 static inline void gpio_unexport(unsigned gpio)
136 gpiod_unexport(gpio_to_desc(gpio));
153 static inline int gpio_cansleep(unsigned gpio)
158 static inline int gpio_get_value_cansleep(unsigned gpio)
161 return __gpio_get_value(gpio);
164 static inline void gpio_set_value_cansleep(unsigned gpio, int value)
167 __gpio_set_value(gpio, value);