summaryrefslogtreecommitdiff
path: root/drivers/pwm
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2018-10-16 21:56:33 -0700
committerJagan Teki <jagan@amarulasolutions.com>2018-10-24 21:56:57 +0530
commita877d4b1aef70bbae556e156e6802b7d917546ab (patch)
tree537d0ba6a9c8a2da929c2cd7446dfacc917f62e5 /drivers/pwm
parent1ed3c0954bd160dafcad8847a51c3ddd5f992f51 (diff)
downloadu-boot-a877d4b1aef70bbae556e156e6802b7d917546ab.tar.gz
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')
-rw-r--r--drivers/pwm/sunxi_pwm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/sunxi_pwm.c b/drivers/pwm/sunxi_pwm.c
index 3c7dffdd90..baee503730 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;