]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/asm-generic/gpio.h
Unified codebase for TX28, TX48, TX51, TX53
[karo-tx-uboot.git] / include / asm-generic / gpio.h
index c19e16cd21dc80cab6c42bfb9a2671ce908231dd..e003103e3c8b91464237a8d21ddd11f309458b16 100644 (file)
  * an error value of -1.
  */
 
+enum gpio_flags {
+       GPIOF_INPUT,
+       GPIOF_OUTPUT_INIT_LOW,
+       GPIOF_OUTPUT_INIT_HIGH,
+};
+
+struct gpio {
+       unsigned int gpio;
+       enum gpio_flags flags;
+       const char *label;
+};
+
 /**
  * Request ownership of a GPIO.
  *
@@ -94,4 +106,25 @@ int gpio_get_value(unsigned gpio);
  */
 int gpio_set_value(unsigned gpio, int value);
 
+/**
+ * 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);
+
+/**
+ * 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);
+
 #endif /* _ASM_GENERIC_GPIO_H_ */