pwm: sunxi: use new prescaler when configuring PWM

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

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
This commit is contained in:
Vasily Khoruzhick 2018-10-16 21:56:34 -07:00 committed by Jagan Teki
parent a877d4b1ae
commit ce138cb429

View file

@ -97,7 +97,7 @@ static int sunxi_pwm_set_config(struct udevice *dev, uint channel,
v &= ~SUNXI_PWM_CTRL_CLK_GATE; v &= ~SUNXI_PWM_CTRL_CLK_GATE;
writel(v, &regs->ctrl); writel(v, &regs->ctrl);
v &= ~SUNXI_PWM_CTRL_PRESCALE0_MASK; 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); writel(v, &regs->ctrl);
v |= SUNXI_PWM_CTRL_CLK_GATE; v |= SUNXI_PWM_CTRL_CLK_GATE;
writel(v, &regs->ctrl); writel(v, &regs->ctrl);