efi_loader: type of efi_secure_mode
[oweals/u-boot.git] / include / asm-generic / gpio.h
index 7c1f71b1accb1a31ea690302daf106f0e1401a10..e16c2f31d9d2a5895ddd854e03805e5e40752c3a 100644 (file)
@@ -8,6 +8,7 @@
 #define _ASM_GENERIC_GPIO_H_
 
 #include <dm/ofnode.h>
+#include <linux/bitops.h>
 
 struct ofnode_phandle_args;
 
@@ -298,6 +299,22 @@ struct dm_gpio_ops {
        int (*xlate)(struct udevice *dev, struct gpio_desc *desc,
                     struct ofnode_phandle_args *args);
 
+       /**
+        * set_dir_flags() - Set GPIO dir flags
+        *
+        * This function should set up the GPIO configuration according to the
+        * information provide by the direction flags bitfield.
+        *
+        * This method is optional.
+        *
+        * @dev:        GPIO device
+        * @offset:     GPIO offset within that device
+        * @flags:      GPIO configuration to use
+        * @return 0 if OK, -ve on error
+        */
+       int (*set_dir_flags)(struct udevice *dev, unsigned int offset,
+                            ulong flags);
+
        /**
         * get_dir_flags() - Get GPIO dir flags
         *