pwm: twl: Reliably disable TWL6030 PWMs
authorPaul Kocialkowski <contact@paulk.fr>
Tue, 29 Mar 2016 18:55:45 +0000 (20:55 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 5 Sep 2016 05:13:47 +0000 (07:13 +0200)
commit45c0ce847a99ca053d432ea98e4ff55d88357d7e
tree326a9da74853c23a24f940beb6b79d045e4c6174
parent29b4817d4018df78086157ea3a55c1d9424a7cfc
pwm: twl: Reliably disable TWL6030 PWMs

The current TWL6030 code for the TWL PWM driver does not reliably disable the
PWM output, as tested with LEDs. The previous commit to that driver introduced
that regression.

However, it does make sense to disable the PWM clock after resetting the PWM,
but for some obscure reason, doing it all at once simply doesn't work.

The TWL6030 datasheet mentions that PWMs have to be disabled in two distinct
steps. However, clearing the clock enable bit in a second step (after issuing a
reset first) does not work.

The only approach that works is the one that was in place before the previous
commit to the driver. It consists in enabling the PWM clock after issuing a
reset. This is what TI kernel trees and production code seem to be using.

However, adding an extra step to disable the PWM clock seems to work reliably,
despite looking quite odd.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-twl.c