4 /* see Documentation/gpio.txt */
6 #ifdef CONFIG_GENERIC_GPIO
11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <linux/errno.h>
19 * Some platforms don't support the GPIO programming interface.
21 * In case some driver uses it anyway (it should normally have
22 * depended on GENERIC_GPIO), these routines help the compiler
23 * optimize out much GPIO-related code ... or trigger a runtime
24 * warning when something is wrongly called.
27 static inline int gpio_is_valid(int number)
32 static inline int __must_check gpio_request(unsigned gpio, const char *label)
37 static inline void gpio_free(unsigned gpio)
41 /* GPIO can never have been requested */
45 static inline int __must_check gpio_direction_input(unsigned gpio)
50 static inline int __must_check gpio_direction_output(unsigned gpio, int value)
55 static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
60 static inline int gpio_get_value(unsigned gpio)
62 /* GPIO can never have been requested or set as {in,out}put */
67 static inline void gpio_set_value(unsigned gpio, int value)
69 /* GPIO can never have been requested or set as output */
73 static inline int gpio_cansleep(unsigned gpio)
75 /* GPIO can never have been requested or set as {in,out}put */
80 static inline int gpio_get_value_cansleep(unsigned gpio)
82 /* GPIO can never have been requested or set as {in,out}put */
87 static inline void gpio_set_value_cansleep(unsigned gpio, int value)
89 /* GPIO can never have been requested or set as output */
93 static inline int gpio_export(unsigned gpio, bool direction_may_change)
95 /* GPIO can never have been requested or set as {in,out}put */
100 static inline int gpio_export_link(struct device *dev, const char *name,
103 /* GPIO can never have been exported */
108 static inline int gpio_sysfs_set_active_low(unsigned gpio, int value)
110 /* GPIO can never have been requested */
115 static inline void gpio_unexport(unsigned gpio)
117 /* GPIO can never have been exported */
121 static inline int gpio_to_irq(unsigned gpio)
123 /* GPIO can never have been requested or set as input */
128 static inline int irq_to_gpio(unsigned irq)
130 /* irq can never have been returned from gpio_to_irq() */
137 #endif /* __LINUX_GPIO_H */