diff mbox

[U-Boot,2/4] power: pwm_regulator: fix the pwm_set_config parameter order

Message ID 1500465263-25544-2-git-send-email-kever.yang@rock-chips.com
State Accepted
Commit f339bca248f8060258c8e53fd9388dc6ca689af3
Delegated to: Philipp Tomsich
Headers show

Commit Message

Kever Yang July 19, 2017, 11:54 a.m. UTC
The rkpwm reg order has fixed by below patch:
e3ef41d rockchip: pwm: fix the register layout for the PWM controller

We need to correct the parameter order for pwm_set_config() to make
the pwm regulator works correctly.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 drivers/power/regulator/pwm_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philipp Tomsich July 19, 2017, 12:42 p.m. UTC | #1
> The rkpwm reg order has fixed by below patch:
> e3ef41d rockchip: pwm: fix the register layout for the PWM controller
> 
> We need to correct the parameter order for pwm_set_config() to make
> the pwm regulator works correctly.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
>  drivers/power/regulator/pwm_regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Philipp Tomsich July 26, 2017, 4:52 p.m. UTC | #2
> The rkpwm reg order has fixed by below patch:
> e3ef41d rockchip: pwm: fix the register layout for the PWM controller
> 
> We need to correct the parameter order for pwm_set_config() to make
> the pwm regulator works correctly.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
>  drivers/power/regulator/pwm_regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Philipp Tomsich July 27, 2017, 8:32 a.m. UTC | #3
> The rkpwm reg order has fixed by below patch:
> e3ef41d rockchip: pwm: fix the register layout for the PWM controller
> 
> We need to correct the parameter order for pwm_set_config() to make
> the pwm regulator works correctly.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
>  drivers/power/regulator/pwm_regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied to u-boot-rockchip, thanks!
Simon Glass July 27, 2017, 3:13 p.m. UTC | #4
On 19 July 2017 at 05:54, Kever Yang <kever.yang@rock-chips.com> wrote:
> The rkpwm reg order has fixed by below patch:
> e3ef41d rockchip: pwm: fix the register layout for the PWM controller
>
> We need to correct the parameter order for pwm_set_config() to make
> the pwm regulator works correctly.
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  drivers/power/regulator/pwm_regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/drivers/power/regulator/pwm_regulator.c b/drivers/power/regulator/pwm_regulator.c
index 00a7cca..fcf5e00 100644
--- a/drivers/power/regulator/pwm_regulator.c
+++ b/drivers/power/regulator/pwm_regulator.c
@@ -80,7 +80,7 @@  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;