diff options
author | Vasily Khoruzhick | 2018-10-16 21:56:33 -0700 |
---|---|---|
committer | Jagan Teki | 2018-10-24 21:56:57 +0530 |
commit | a877d4b1aef70bbae556e156e6802b7d917546ab (patch) | |
tree | 537d0ba6a9c8a2da929c2cd7446dfacc917f62e5 /drivers/pwm/sunxi_pwm.c | |
parent | 1ed3c0954bd160dafcad8847a51c3ddd5f992f51 (diff) |
pwm: sunxi: fix off-by-one that prevented PWM to use prescaler bypass
Fix off-by-one that prevented PWM driver to use prescaler bypass.
Without this change prescaler is always enabled.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'drivers/pwm/sunxi_pwm.c')
-rw-r--r-- | drivers/pwm/sunxi_pwm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/sunxi_pwm.c b/drivers/pwm/sunxi_pwm.c index 3c7dffdd909..baee5037306 100644 --- a/drivers/pwm/sunxi_pwm.c +++ b/drivers/pwm/sunxi_pwm.c @@ -74,7 +74,7 @@ static int sunxi_pwm_set_config(struct udevice *dev, uint channel, debug("%s: period_ns=%u, duty_ns=%u\n", __func__, period_ns, duty_ns); - for (prescaler = 0; prescaler < SUNXI_PWM_CTRL_PRESCALE0_MASK; + for (prescaler = 0; prescaler <= SUNXI_PWM_CTRL_PRESCALE0_MASK; prescaler++) { if (!prescaler_table[prescaler]) continue; |