diff options
author | Przemyslaw Marczak <p.marczak@samsung.com> | 2015-10-27 13:07:59 +0100 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2015-11-02 10:38:00 +0900 |
commit | 7c816e24a4e980e2717e5c83090dec73bc4eac57 (patch) | |
tree | 74c43945c673449ce4a91adb1d4a596202aa8036 /drivers/power | |
parent | 35d460fbc8ced954fe23812e706d3eebc1dd2b4d (diff) | |
download | u-boot-7c816e24a4e980e2717e5c83090dec73bc4eac57.tar.gz u-boot-7c816e24a4e980e2717e5c83090dec73bc4eac57.tar.bz2 u-boot-7c816e24a4e980e2717e5c83090dec73bc4eac57.zip |
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>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/regulator/regulator-uclass.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index a5170df916..4241a4c7f2 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -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; |