X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Fpower%2Fregulator%2Fpwm_regulator.c;h=b63f941990d512b2a3c94e1af9d26f6a92863648;hb=19d1f1a2f3ccfbf85125150f7876ce22714b38bd;hp=a6c9fccd68e7c16c4340e574f0037d098b03603e;hpb=0b60111aa66f51d05473a375070ca72d073a6fd3;p=platform%2Fkernel%2Fu-boot.git diff --git a/drivers/power/regulator/pwm_regulator.c b/drivers/power/regulator/pwm_regulator.c index a6c9fcc..b63f941 100644 --- 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 */ - unsigned int init_voltage; + int init_voltage; /* the maximum voltage of regulator */ - unsigned int max_voltage; + int max_voltage; /* the minimum voltage of regulator */ - unsigned int min_voltage; + int min_voltage; /* the current voltage of regulator */ - unsigned int volt_uV; + int volt_uV; }; 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, - (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; } - 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; + 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); - pwm_regulator_enable(dev, 1); - return 0; }