At present the counter never hits the comparitor in this case. Add a
special case.
This ensures that the snow backlight works when at full brightness.
Fixes: 76c2ff3e5fd video: backlight: fix pwm's duty cycle calculation
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
tcnt = period_ns / rate_ns;
tcmp = duty_ns / rate_ns;
debug("%s: tcnt %u, tcmp %u\n", __func__, tcnt, tcmp);
+
+ /* Ensure that the comparitor will actually hit the target */
+ if (tcmp == tcnt)
+ tcmp = tcnt - 1;
offset = channel * 3;
writel(tcnt, ®s->tcntb0 + offset);
writel(tcmp, ®s->tcmpb0 + offset);