pwm: rockchip: State of pwm clock should synchronize with pwm enabled state
authordavid.wu <david.wu@rock-chips.com>
Tue, 28 Feb 2017 03:23:34 +0000 (11:23 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 6 Mar 2017 10:28:40 +0000 (18:28 +0800)
commit00537de90cbc24e7555c1cb98e1992a5f9649714
treec37a030da1d8c3e38fef3e5f8d5a01abecf1753f
parent22f81326b558780967a0046e77256b34ae06e384
pwm: rockchip: State of pwm clock should synchronize with pwm enabled state

If the pwm was not enabled at uboot 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 uboot 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/disable, and
pwm driver ensure state of pwm clock synchronized with pwm enabled state.

Change-Id: I545db81eb638957567abacb93fd06fff9dd7181b
Fixes: 2bf1c98aa5a4 ("pwm: rockchip: Add support for atomic update")
Signed-off-by: David Wu <david.wu@rock-chips.com>
drivers/pwm/pwm-rockchip.c