summaryrefslogtreecommitdiff
path: root/drivers/power/regulator
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-05-08 13:47:39 -0400
committerTom Rini <trini@konsulko.com>2018-05-08 13:47:39 -0400
commit14249635b6aa7615f356099cfb349d0a820f9bed (patch)
treee8fcc22be59a77f9dbe200b63f08f9b741706429 /drivers/power/regulator
parent1ccd3f14ca0a481ce173cd0ce4fd1a66d50a4985 (diff)
parente1fd9e6bb88a3f42e7e89e9c59589dbf904efe23 (diff)
downloadu-boot-14249635b6aa7615f356099cfb349d0a820f9bed.tar.gz
Merge git://git.denx.de/u-boot-mmc
Diffstat (limited to 'drivers/power/regulator')
-rw-r--r--drivers/power/regulator/pwm_regulator.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/power/regulator/pwm_regulator.c b/drivers/power/regulator/pwm_regulator.c
index f353c38a04..cd05c9b603 100644
--- a/drivers/power/regulator/pwm_regulator.c
+++ b/drivers/power/regulator/pwm_regulator.c
@@ -12,9 +12,6 @@
#include <errno.h>
#include <pwm.h>
#include <power/regulator.h>
-#include <linux/libfdt.h>
-#include <fdt_support.h>
-#include <fdtdec.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -93,13 +90,10 @@ static int pwm_regulator_set_voltage(struct udevice *dev, int uvolt)
static int pwm_regulator_ofdata_to_platdata(struct udevice *dev)
{
struct pwm_regulator_info *priv = dev_get_priv(dev);
- struct fdtdec_phandle_args args;
- const void *blob = gd->fdt_blob;
- int node = dev_of_offset(dev);
+ struct ofnode_phandle_args args;
int ret;
- ret = fdtdec_parse_phandle_with_args(blob, node, "pwms", "#pwm-cells",
- 0, 0, &args);
+ ret = dev_read_phandle_with_args(dev, "pwms", "#pwm-cells", 0, 0, &args);
if (ret) {
debug("%s: Cannot get PWM phandle: ret=%d\n", __func__, ret);
return ret;
@@ -108,14 +102,13 @@ static int pwm_regulator_ofdata_to_platdata(struct udevice *dev)
priv->period_ns = args.args[1];
priv->polarity = args.args[2];
- priv->init_voltage = fdtdec_get_int(blob, node,
- "regulator-init-microvolt", -1);
+ priv->init_voltage = dev_read_u32_default(dev, "regulator-init-microvolt", -1);
if (priv->init_voltage < 0) {
printf("Cannot find regulator pwm init_voltage\n");
return -EINVAL;
}
- ret = uclass_get_device_by_of_offset(UCLASS_PWM, args.node, &priv->pwm);
+ ret = uclass_get_device_by_ofnode(UCLASS_PWM, args.node, &priv->pwm);
if (ret) {
debug("%s: Cannot get PWM: ret=%d\n", __func__, ret);
return ret;