summaryrefslogtreecommitdiffstats
path: root/include/syscon.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-17 16:11:08 -0700
committerBin Meng <bmeng.cn@gmail.com>2016-01-24 12:07:19 +0800
commitac94b7bcbed9a5ee71f6fb9a507c72abf601cb8a (patch)
tree8158f7f6868c310d114e0336413f75d239850a00 /include/syscon.h
parent907eed2ce36db8407d56edc305c32b0923934322 (diff)
downloadblackbird-obmc-uboot-ac94b7bcbed9a5ee71f6fb9a507c72abf601cb8a.tar.gz
blackbird-obmc-uboot-ac94b7bcbed9a5ee71f6fb9a507c72abf601cb8a.zip
dm: syscon: Allow finding devices by driver data
We have a way to find a regmap by its syscon driver data value. Add the same for syscon itself. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/syscon.h')
-rw-r--r--include/syscon.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/syscon.h b/include/syscon.h
index c62ccd61b3..4593b6e3eb 100644
--- a/include/syscon.h
+++ b/include/syscon.h
@@ -37,6 +37,20 @@ struct regmap *syscon_get_regmap(struct udevice *dev);
*
* 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
+ *
+ * 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 regmap given this driver data.
*
* @driver_data: Driver data value to look up
OpenPOWER on IntegriCloud