Merge tag 'u-boot-imx-20190426' of git://git.denx.de/u-boot-imx
[platform/kernel/u-boot.git] / include / reset.h
index bc495a9..a1a9ad5 100644 (file)
@@ -43,6 +43,8 @@ struct udevice;
  * @data: An optional data field for scenarios where a single integer ID is not
  *       sufficient. If used, it can be populated through an .of_xlate op and
  *       processed during the various reset ops.
+ * @polarity: An optional polarity field for drivers that support
+ *       different reset polarities.
  *
  * Should additional information to identify and configure any reset signal
  * for any provider be required in the future, the struct could be expanded to
@@ -59,6 +61,7 @@ struct reset_ctl {
         */
        unsigned long id;
        unsigned long data;
+       unsigned long polarity;
 };
 
 /**
@@ -306,4 +309,15 @@ static inline int reset_release_bulk(struct reset_ctl_bulk *bulk)
 }
 #endif
 
+/**
+ * reset_valid() - check if reset is valid
+ *
+ * @reset_ctl:         the reset to check
+ * @return TRUE if valid, or FALSE
+ */
+static inline bool reset_valid(struct reset_ctl *reset_ctl)
+{
+       return !!reset_ctl->dev;
+}
+
 #endif