summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/gpio.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-03-31 14:55:14 +1000
committerDave Airlie <airlied@redhat.com>2010-03-31 14:55:14 +1000
commit3595be778d8cb887f0e0575ef0a0c1a094d120bb (patch)
tree15671ed8bd3597d2efe13aa57b755c66014acb57 /include/asm-generic/gpio.h
parentc414a117c6094c3f86b533f97beaf45ef9075f03 (diff)
parent220bf991b0366cc50a94feede3d7341fa5710ee4 (diff)
Merge branch 'v2.6.34-rc2' into drm-linus
Diffstat (limited to 'include/asm-generic/gpio.h')
-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 485eeb6c4ef..979c6a57f2f 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -136,6 +136,32 @@ extern int __gpio_cansleep(unsigned gpio);
extern int __gpio_to_irq(unsigned gpio);
+#define GPIOF_DIR_OUT (0 << 0)
+#define GPIOF_DIR_IN (1 << 0)
+
+#define GPIOF_INIT_LOW (0 << 1)
+#define GPIOF_INIT_HIGH (1 << 1)
+
+#define GPIOF_IN (GPIOF_DIR_IN)
+#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
+#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
+
+/**
+ * struct gpio - a structure describing a GPIO with configuration
+ * @gpio: the GPIO number
+ * @flags: GPIO configuration as specified by GPIOF_*
+ * @label: a literal description string of this GPIO
+ */
+struct gpio {
+ unsigned gpio;
+ unsigned long flags;
+ const char *label;
+};
+
+extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
+extern int gpio_request_array(struct gpio *array, size_t num);
+extern void gpio_free_array(struct gpio *array, size_t num);
+
#ifdef CONFIG_GPIO_SYSFS
/*