dm: core: Add uclass_first_device_err() to return a valid device
[oweals/u-boot.git] / include / syscon.h
index c62ccd61b329b66461395cccd4d315e58975a972..4593b6e3ebfdb96e7869cc9cc88045eaa42cb35d 100644 (file)
@@ -32,6 +32,20 @@ struct syscon_ops {
  */
 struct regmap *syscon_get_regmap(struct udevice *dev);
 
+/**
+ * syscon_get_regmap_by_driver_data() - Look up a controller by its ID
+ *
+ * Each system controller can be accessed by its driver data, which is
+ * assumed to be unique through the scope of all system controllers that
+ * are in use. This function looks up the controller given this driver data.
+ *
+ * @driver_data:       Driver data value to look up
+ * @devp:              Returns the controller correponding to @driver_data
+ * @return 0 on success, -ENODEV if the ID was not found, or other -ve error
+ *        code
+ */
+int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp);
+
 /**
  * syscon_get_regmap_by_driver_data() - Look up a controller by its ID
  *