dm: Add a function to bind a device by driver name

In some cases we need to manually bind a device to a particular driver.
Add a function to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
Simon Glass
2014-11-11 10:46:21 -07:00
parent a88340dfcf
commit e33dc221f4
2 changed files with 34 additions and 0 deletions

View File

@@ -60,4 +60,17 @@ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only);
int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
struct udevice **devp);
/**
* device_bind_driver() - bind a device to a driver
*
* This binds a new device to a driver.
*
* @parent: Parent device
* @drv_name: Name of driver to attach to this parent
* @dev_name: Name of the new device thus created
* @devp: Returns the newly bound device
*/
int device_bind_driver(struct udevice *parent, const char *drv_name,
const char *dev_name, struct udevice **devp);
#endif