[U-Boot] [PATCH 2/3] pwm: sunxi: use new prescaler when configuring PWM

Vasily Khoruzhick anarsoul at gmail.com
Wed Oct 17 04:56:34 UTC 2018


Looks like old prescaler was used when configuring PWM, fix it.

Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
---
 drivers/pwm/sunxi_pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/sunxi_pwm.c b/drivers/pwm/sunxi_pwm.c
index baee503730..6284409b4f 100644
--- a/drivers/pwm/sunxi_pwm.c
+++ b/drivers/pwm/sunxi_pwm.c
@@ -97,7 +97,7 @@ static int sunxi_pwm_set_config(struct udevice *dev, uint channel,
 		v &= ~SUNXI_PWM_CTRL_CLK_GATE;
 		writel(v, &regs->ctrl);
 		v &= ~SUNXI_PWM_CTRL_PRESCALE0_MASK;
-		v |= (priv->prescaler & SUNXI_PWM_CTRL_PRESCALE0_MASK);
+		v |= (prescaler & SUNXI_PWM_CTRL_PRESCALE0_MASK);
 		writel(v, &regs->ctrl);
 		v |= SUNXI_PWM_CTRL_CLK_GATE;
 		writel(v, &regs->ctrl);
-- 
2.19.0



More information about the U-Boot mailing list