pwm: omap-dmtimer: Fix PWM enabling sequence
authorLokesh Vutla <lokeshvutla@ti.com>
Thu, 12 Mar 2020 04:22:08 +0000 (09:52 +0530)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 30 Mar 2020 16:03:07 +0000 (18:03 +0200)
commit867beb60d131f7a5cde88ba375338285fdc6ddb8
tree4d4f2a8f396989c859611fe915829a1f25e5bb49
parent348fb6f7fb4cc7ebc35d1cde6e5c2ada64b683c6
pwm: omap-dmtimer: Fix PWM enabling sequence

To configure DM timer in PWM mode the following needs to be set in
OMAP_TIMER_CTRL_REG using set_pwm callback:
- Set toggle mode on PORTIMERPWM output pin
- Set trigger on overflow and match on PORTIMERPWM output pin.
- Set auto reload

This is a one time configuration and needs to be set before the start of
the DM timer. But the current driver tries to set the same configuration
for every period/duty cycle update, which is not needed. So move the PWM
setup before enabling timer and do not update it in
pwm_omap_dmtimer_config().

Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-omap-dmtimer.c