]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/asm-generic/gpio.h
dm: gpio: Add a native driver model API
[karo-tx-uboot.git] / include / asm-generic / gpio.h
index 36a36c64b8a6a19879e5236eb85af2fd5960a43d..a827a56f5e11679002caeb0ec48e1052d357aa15 100644 (file)
@@ -95,6 +95,22 @@ enum gpio_func_t {
 
 struct udevice;
 
+struct gpio_desc {
+       struct udevice *dev;    /* Device, NULL for invalid GPIO */
+       unsigned long flags;
+#define GPIOD_REQUESTED                (1 << 0)        /* Requested/claimed */
+#define GPIOD_IS_OUT           (1 << 1)        /* GPIO is an output */
+#define GPIOD_IS_IN            (1 << 2)        /* GPIO is an output */
+#define GPIOD_ACTIVE_LOW       (1 << 3)        /* value has active low */
+#define GPIOD_IS_OUT_ACTIVE    (1 << 4)        /* set output active */
+
+       uint offset;            /* GPIO offset within the device */
+       /*
+        * We could consider adding the GPIO label in here. Possibly we could
+        * use this structure for internal GPIO information.
+        */
+};
+
 /**
  * gpio_get_status() - get the current GPIO status as a string
  *