dm: core: add support for device re-parenting

In common clock framework the relation b/w parent and child clocks is
determined based on the udevice parent/child information. A clock
parent could be changed based on devices needs. In case this is happen
the functionalities for clock who's parent is changed are broken. Add
a function that reparent a device. This will be used in clk-uclass.c
to reparent a clock device.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Claudiu Beznea 2020-09-07 17:46:33 +03:00 committed by Eugen Hristev
parent b04da9fcf7
commit cfecbaf4e7
3 changed files with 191 additions and 0 deletions

View file

@ -83,6 +83,15 @@ int device_bind_with_driver_data(struct udevice *parent,
int device_bind_by_name(struct udevice *parent, bool pre_reloc_only,
struct driver_info *info, struct udevice **devp);
/**
* device_reparent: reparent the device to a new parent
*
* @dev: pointer to device to be reparented
* @new_parent: pointer to new parent device
* @return 0 if OK, -ve on error
*/
int device_reparent(struct udevice *dev, struct udevice *new_parent);
/**
* device_ofdata_to_platdata() - Read platform data for a device
*