4 /* see Documentation/gpio.txt */
6 #ifdef CONFIG_GENERIC_GPIO
11 #include <linux/types.h>
12 #include <linux/errno.h>
15 * Some platforms don't support the GPIO programming interface.
17 * In case some driver uses it anyway (it should normally have
18 * depended on GENERIC_GPIO), these routines help the compiler
19 * optimize out much GPIO-related code ... or trigger a runtime
20 * warning when something is wrongly called.
23 static inline int gpio_is_valid(int number)
28 static inline int gpio_request(unsigned gpio, const char *label)
33 static inline void gpio_free(unsigned gpio)
35 /* GPIO can never have been requested */
39 static inline int gpio_direction_input(unsigned gpio)
44 static inline int gpio_direction_output(unsigned gpio, int value)
49 static inline int gpio_get_value(unsigned gpio)
51 /* GPIO can never have been requested or set as {in,out}put */
56 static inline void gpio_set_value(unsigned gpio, int value)
58 /* GPIO can never have been requested or set as output */
62 static inline int gpio_cansleep(unsigned gpio)
64 /* GPIO can never have been requested or set as {in,out}put */
69 static inline int gpio_get_value_cansleep(unsigned gpio)
71 /* GPIO can never have been requested or set as {in,out}put */
76 static inline void gpio_set_value_cansleep(unsigned gpio, int value)
78 /* GPIO can never have been requested or set as output */
82 static inline int gpio_export(unsigned gpio, bool direction_may_change)
84 /* GPIO can never have been requested or set as {in,out}put */
89 static inline void gpio_unexport(unsigned gpio)
91 /* GPIO can never have been exported */
95 static inline int gpio_to_irq(unsigned gpio)
97 /* GPIO can never have been requested or set as input */
102 static inline int irq_to_gpio(unsigned irq)
104 /* irq can never have been returned from gpio_to_irq() */
111 #endif /* __LINUX_GPIO_H */