]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: rockchip: State of PWM clock should synchronize with PWM enabled state
authorDavid Wu <david.wu@rock-chips.com>
Wed, 1 Mar 2017 11:10:55 +0000 (19:10 +0800)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 6 Apr 2017 13:08:52 +0000 (15:08 +0200)
commitbbba7556d2957d1b35ce197b8847af6171afcd6b
treeb2c1710e98c98cf6cfb2db2bcdf8c2778e9422c8
parentd610e30f3179d2253316ad853ed35709a2909aec
pwm: rockchip: State of PWM clock should synchronize with PWM enabled state

If the PWM was not enabled at U-Boot loader, PWM could not work for
clock always disabled at PWM driver. The PWM clock is enabled at
beginning of pwm_apply(), but disabled at end of pwm_apply().

If the PWM was enabled at U-Boot loader, PWM clock is always enabled
unless closed by ATF. The pwm-backlight might turn off the power at
early suspend, should disable PWM clock for saving power consume.

It is important to provide opportunity to enable/disable clock at PWM
driver, the PWM consumer should ensure correct order to call PWM enable
and disable, and PWM driver ensure state of PWM clock synchronized with
PWM enabled state.

Fixes: 2937b423a25b ("pwm: rockchip: Add support for atomic update")
Cc: stable@vger.kernel.org
Signed-off-by: David Wu <david.wu@rock-chips.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-rockchip.c