4 /* see Documentation/gpio.txt */
6 /* make these flag values available regardless of GPIO kconfig options */
7 #define GPIOF_DIR_OUT (0 << 0)
8 #define GPIOF_DIR_IN (1 << 0)
10 #define GPIOF_INIT_LOW (0 << 1)
11 #define GPIOF_INIT_HIGH (1 << 1)
13 #define GPIOF_IN (GPIOF_DIR_IN)
14 #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
15 #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
18 * struct gpio - a structure describing a GPIO with configuration
19 * @gpio: the GPIO number
20 * @flags: GPIO configuration as specified by GPIOF_*
21 * @label: a literal description string of this GPIO
29 #ifdef CONFIG_GENERIC_GPIO
34 #include <linux/kernel.h>
35 #include <linux/types.h>
36 #include <linux/errno.h>
41 static inline bool gpio_is_valid(int number
)
46 static inline int gpio_request(unsigned gpio
, const char *label
)
51 static inline int gpio_request_one(unsigned gpio
,
52 unsigned long flags
, const char *label
)
57 static inline int gpio_request_array(const struct gpio
*array
, size_t num
)
62 static inline void gpio_free(unsigned gpio
)
66 /* GPIO can never have been requested */
70 static inline void gpio_free_array(const struct gpio
*array
, size_t num
)
74 /* GPIO can never have been requested */
78 static inline int gpio_direction_input(unsigned gpio
)
83 static inline int gpio_direction_output(unsigned gpio
, int value
)
88 static inline int gpio_set_debounce(unsigned gpio
, unsigned debounce
)
93 static inline int gpio_get_value(unsigned gpio
)
95 /* GPIO can never have been requested or set as {in,out}put */
100 static inline void gpio_set_value(unsigned gpio
, int value
)
102 /* GPIO can never have been requested or set as output */
106 static inline int gpio_cansleep(unsigned gpio
)
108 /* GPIO can never have been requested or set as {in,out}put */
113 static inline int gpio_get_value_cansleep(unsigned gpio
)
115 /* GPIO can never have been requested or set as {in,out}put */
120 static inline void gpio_set_value_cansleep(unsigned gpio
, int value
)
122 /* GPIO can never have been requested or set as output */
126 static inline int gpio_export(unsigned gpio
, bool direction_may_change
)
128 /* GPIO can never have been requested or set as {in,out}put */
133 static inline int gpio_export_link(struct device
*dev
, const char *name
,
136 /* GPIO can never have been exported */
141 static inline int gpio_sysfs_set_active_low(unsigned gpio
, int value
)
143 /* GPIO can never have been requested */
148 static inline void gpio_unexport(unsigned gpio
)
150 /* GPIO can never have been exported */
154 static inline int gpio_to_irq(unsigned gpio
)
156 /* GPIO can never have been requested or set as input */
161 static inline int irq_to_gpio(unsigned irq
)
163 /* irq can never have been returned from gpio_to_irq() */
170 #endif /* __LINUX_GPIO_H */
This page took 0.034835 seconds and 5 git commands to generate.