aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 485eeb6c4ef3..979c6a57f2f1 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -136,6 +136,32 @@ extern int __gpio_cansleep(unsigned gpio);
136 136
137extern int __gpio_to_irq(unsigned gpio); 137extern int __gpio_to_irq(unsigned gpio);
138 138
139#define GPIOF_DIR_OUT (0 << 0)
140#define GPIOF_DIR_IN (1 << 0)
141
142#define GPIOF_INIT_LOW (0 << 1)
143#define GPIOF_INIT_HIGH (1 << 1)
144
145#define GPIOF_IN (GPIOF_DIR_IN)
146#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
147#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
148
149/**
150 * struct gpio - a structure describing a GPIO with configuration
151 * @gpio: the GPIO number
152 * @flags: GPIO configuration as specified by GPIOF_*
153 * @label: a literal description string of this GPIO
154 */
155struct gpio {
156 unsigned gpio;
157 unsigned long flags;
158 const char *label;
159};
160
161extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
162extern int gpio_request_array(struct gpio *array, size_t num);
163extern void gpio_free_array(struct gpio *array, size_t num);
164
139#ifdef CONFIG_GPIO_SYSFS 165#ifdef CONFIG_GPIO_SYSFS
140 166
141/* 167/*