]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/asm-generic/gpio.h
karo: merge with Ka-Ro specific tree for secure boot support
[karo-tx-uboot.git] / include / asm-generic / gpio.h
index 36a36c64b8a6a19879e5236eb85af2fd5960a43d..0d87e508c0d9bc66f9a324e9e781df755084ca52 100644 (file)
  * an error value of -1.
  */
 
+enum gpio_flags {
+       GPIOFLAG_INPUT,
+       GPIOFLAG_OUTPUT_INIT_LOW,
+       GPIOFLAG_OUTPUT_INIT_HIGH,
+};
+
+struct gpio {
+       unsigned int gpio;
+       enum gpio_flags flags;
+       const char *label;
+};
+
 /**
  * Request a GPIO. This should be called before any of the other functions
  * are used on this GPIO.
  */
 int gpio_request(unsigned gpio, const char *label);
 
+/**
+ * Request a GPIO and configure it
+ * @param gpios        pointer to array of gpio defs
+ * @param count        number of GPIOs to set up
+ */
+int gpio_request_one(unsigned gpio, enum gpio_flags flags, const char *label);
+
+/**
+ * Request a set of GPIOs and configure them
+ * @param gpios        pointer to array of gpio defs
+ * @param count        number of GPIOs to set up
+ */
+int gpio_request_array(const struct gpio *gpios, int count);
+
 /**
  * Stop using the GPIO.  This function should not alter pin configuration.
  *
@@ -46,6 +72,13 @@ int gpio_request(unsigned gpio, const char *label);
  */
 int gpio_free(unsigned gpio);
 
+/**
+ * Release a set of GPIOs
+ * @param gpios        pointer to array of gpio defs
+ * @param count        number of GPIOs to set up
+ */
+int gpio_free_array(const struct gpio *gpios, int count);
+
 /**
  * Make a GPIO an input.
  *