aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-12-29 21:19:20 -0700
committerSimon Glass <sjg@chromium.org>2020-01-07 16:02:38 -0700
commitbcd90cb6928414e14942c01af374863d4049a25d (patch)
treea723be66a27d3376b82553841b38a969cc766b5e /include
parent04e19ffded40d97502961485a3ce7db6f3d590be (diff)
downloadu-boot-bcd90cb6928414e14942c01af374863d4049a25d.zip
u-boot-bcd90cb6928414e14942c01af374863d4049a25d.tar.gz
u-boot-bcd90cb6928414e14942c01af374863d4049a25d.tar.bz2
dm: core: Export a new function to read platdata
Add a new internal function, device_ofdata_to_platdata() to handle allocating private space associated with each device and reading the platform data from the device tree. Call this new function from device_probe(). Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/dm/device-internal.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index ee2b24a..294d6c1 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -84,6 +84,22 @@ int device_bind_by_name(struct udevice *parent, bool pre_reloc_only,
const struct driver_info *info, struct udevice **devp);
/**
+ * device_ofdata_to_platdata() - Read platform data for a device
+ *
+ * Read platform data for a device (typically from the device tree) so that
+ * the information needed to probe the device is present.
+ *
+ * This may cause some others devices to be probed if this one depends on them,
+ * e.g. a GPIO line will cause a GPIO device to be probed.
+ *
+ * All private data associated with the device is allocated.
+ *
+ * @dev: Pointer to device to process
+ * @return 0 if OK, -ve on error
+ */
+int device_ofdata_to_platdata(struct udevice *dev);
+
+/**
* device_probe() - Probe a device, activating it
*
* Activate a device so that it is ready for use. All its parents are probed