diff options
author | Simon Glass <sjg@chromium.org> | 2014-10-13 23:41:50 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-10-22 10:36:46 -0600 |
commit | accd4b19b39bde7398aa8d1a8eeb66f3a14dde5b (patch) | |
tree | 09bcc8e1c9ebd5b6213bdb198b35691f8902e57a /include/dm/device-internal.h | |
parent | a8981d4f80b010666ad754d20a4f389f94d6726d (diff) |
dm: core: Allow parents to pass data to children during probe
Buses sometimes want to pass data to their children when they are probed.
For example, a SPI bus may want to tell the slave device about the chip
select it is connected to.
Add a new function to permit the parent data to be supplied to the child.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Diffstat (limited to 'include/dm/device-internal.h')
-rw-r--r-- | include/dm/device-internal.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index 7005d03d08..44cb7ef93b 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -66,6 +66,19 @@ int device_bind_by_name(struct udevice *parent, bool pre_reloc_only, int device_probe(struct udevice *dev); /** + * device_probe() - Probe a child device, activating it + * + * Activate a device so that it is ready for use. All its parents are probed + * first. The child is provided with parent data if parent_priv is not NULL. + * + * @dev: Pointer to device to probe + * @parent_priv: Pointer to parent data. If non-NULL then this is provided to + * the child. + * @return 0 if OK, -ve on error + */ +int device_probe_child(struct udevice *dev, void *parent_priv); + +/** * device_remove() - Remove a device, de-activating it * * De-activate a device so that it is no longer ready for use. All its |