projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.denx.de/u-boot-socfpga
[platform/kernel/u-boot.git]
/
drivers
/
power
/
regulator
/
pwm_regulator.c
diff --git
a/drivers/power/regulator/pwm_regulator.c
b/drivers/power/regulator/pwm_regulator.c
index
a6c9fcc
..
b63f941
100644
(file)
--- a/
drivers/power/regulator/pwm_regulator.c
+++ b/
drivers/power/regulator/pwm_regulator.c
@@
-32,13
+32,13
@@
struct pwm_regulator_info {
bool polarity;
struct udevice *pwm;
/* initialize voltage of regulator */
bool polarity;
struct udevice *pwm;
/* initialize voltage of regulator */
-
unsigned
int init_voltage;
+ int init_voltage;
/* the maximum voltage of regulator */
/* the maximum voltage of regulator */
-
unsigned
int max_voltage;
+ int max_voltage;
/* the minimum voltage of regulator */
/* the minimum voltage of regulator */
-
unsigned
int min_voltage;
+ int min_voltage;
/* the current voltage of regulator */
/* the current voltage of regulator */
-
unsigned
int volt_uV;
+ int volt_uV;
};
static int pwm_regulator_enable(struct udevice *dev, bool enable)
};
static int pwm_regulator_enable(struct udevice *dev, bool enable)
@@
-80,18
+80,14
@@
static int pwm_regulator_set_voltage(struct udevice *dev, int uvolt)
}
ret = pwm_set_config(priv->pwm, priv->pwm_id,
}
ret = pwm_set_config(priv->pwm, priv->pwm_id,
-
(priv->period_ns / 100) * duty_cycle, priv->period_ns
);
+
priv->period_ns, (priv->period_ns / 100) * duty_cycle
);
if (ret) {
dev_err(dev, "Failed to configure PWM\n");
return ret;
}
if (ret) {
dev_err(dev, "Failed to configure PWM\n");
return ret;
}
- ret = pwm_set_enable(priv->pwm, priv->pwm_id, true);
- if (ret) {
- dev_err(dev, "Failed to enable PWM\n");
- return ret;
- }
priv->volt_uV = uvolt;
priv->volt_uV = uvolt;
+
return ret;
}
return ret;
}
@@
-144,8
+140,6
@@
static int pwm_regulator_probe(struct udevice *dev)
if (priv->init_voltage)
pwm_regulator_set_voltage(dev, priv->init_voltage);
if (priv->init_voltage)
pwm_regulator_set_voltage(dev, priv->init_voltage);
- pwm_regulator_enable(dev, 1);
-
return 0;
}
return 0;
}