forked from OERV-BSP/u-boot
dm: regulator: add function device_get_supply_regulator()
Some devices are supplied by configurable regulator's output. But there was no function for getting it. This commit adds function, that allows for getting the supply device by it's phandle. The returned regulator device can be used with regulator uclass's API. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
committed by
Minkyu Kang
parent
35d460fbc8
commit
7c816e24a4
@@ -138,6 +138,13 @@ int regulator_get_by_devname(const char *devname, struct udevice **devp)
|
||||
return uclass_get_device_by_name(UCLASS_REGULATOR, devname, devp);
|
||||
}
|
||||
|
||||
int device_get_supply_regulator(struct udevice *dev, const char *supply_name,
|
||||
struct udevice **devp)
|
||||
{
|
||||
return uclass_get_device_by_phandle(UCLASS_REGULATOR, dev,
|
||||
supply_name, devp);
|
||||
}
|
||||
|
||||
int regulator_autoset(struct udevice *dev)
|
||||
{
|
||||
struct dm_regulator_uclass_platdata *uc_pdata;
|
||||
|
||||
Reference in New Issue
Block a user