* 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.
+ * Request a gpio. This should be called before any of the other functions
+ * are used on this gpio.
*
- * @param gpio GPIO number
- * @param label Name given to the GPIO
+ * @param gp GPIO number
+ * @param label User label for this GPIO
* @return 0 if ok, -1 on error
*/
int gpio_request(unsigned gpio, const char *label);
*/
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_ */