Merge branch 'master' into devel
[linux-drm-fsl-dcu.git] / arch / arm / plat-s3c / pwm.c
index f3d37ac5595bc90b3319d5683e48d7780a00b94c..4fdc5b307fd2f95cb3a0ae1152030b22588bc079 100644 (file)
@@ -247,6 +247,10 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
 
        tcmp = duty_ns / tin_ns;
        tcmp = tcnt - tcmp;
+       /* the pwm hw only checks the compare register after a decrement,
+          so the pin never toggles if tcmp = tcnt */
+       if (tcmp == tcnt)
+               tcmp--;
 
        pwm_dbg(pwm, "tin_ns=%lu, tcmp=%ld/%lu\n", tin_ns, tcmp, tcnt);