diff options
| author | Simon Glass <[email protected]> | 2021-11-03 13:21:33 -0600 |
|---|---|---|
| committer | Minkyu Kang <[email protected]> | 2021-11-09 11:57:22 +0900 |
| commit | dfb8470fd0b3b8a87c047b9c1765a1b9123b83b7 (patch) | |
| tree | 287a938c5af8b07e0a62abd17e6fef8f395b20ec /drivers | |
| parent | f8ed9059001d803b0eae4b49178789aa0e29edec (diff) | |
exynos: pwm: Deal with a PWM at 100%
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 <[email protected]>
Signed-off-by: Minkyu Kang <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/pwm/exynos_pwm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pwm/exynos_pwm.c b/drivers/pwm/exynos_pwm.c index 1afaf784dab..609025d680d 100644 --- a/drivers/pwm/exynos_pwm.c +++ b/drivers/pwm/exynos_pwm.c @@ -43,6 +43,10 @@ static int exynos_pwm_set_config(struct udevice *dev, uint channel, 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); |
